@registry = BotRegistry.new self
- @timer = Timer::Timer.new(1.0) # only need per-second granularity
+ @timer = Timer.new
@save_mutex = Mutex.new
if @config['core.save_every'] > 0
@save_timer = @timer.add(@config['core.save_every']) { save }
@logs = Hash.new
@plugins = nil
- @lang = Language::Language.new(self, @config['core.language'])
+ @lang = Language.new(self, @config['core.language'])
begin
@auth = Auth::authmanager
begin
quit if $interrupted > 0
connect
- @timer.start
quit_msg = nil
while @socket.connected?
# end
debug "\tdisconnecting..."
disconnect(message)
+ debug "\tstopping timer..."
+ @timer.stop
debug "\tsaving ..."
save
debug "\tcleaning up ..."
@save_mutex.synchronize do
@plugins.cleanup
end
- debug "\tstopping timers ..."
- @timer.stop
+ # debug "\tstopping timers ..."
+ # @timer.stop
# debug "Closing registries"
# @registry.close
debug "\t\tcleaning up the db environment ..."
# call the rescan method for all of the botmodules
def rescan
+ debug "\tstopping timer..."
+ @timer.stop
@save_mutex.synchronize do
@lang.rescan
@plugins.rescan
end
+ @timer.start
end
# channel:: channel to join