Skip to content

Commit

Permalink
Add option to disable the feature TaskManager
Browse files Browse the repository at this point in the history
  • Loading branch information
urthub committed Mar 16, 2014
1 parent acdb9df commit 93a613f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spunky.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,19 @@ def read_log(self):
"""
read the logfile
"""
# create instance of TaskManager
tasks = TaskManager(CONFIG.getint('bot', 'max_ping'), CONFIG.getint('bot', 'kick_spec_full_server'), game.rcon_handle)
task_frequency = CONFIG.getint('bot', 'task_frequency')
if task_frequency > 0:
# create instance of TaskManager
tasks = TaskManager(CONFIG.getint('bot', 'max_ping'), CONFIG.getint('bot', 'kick_spec_full_server'), game.rcon_handle)
# schedule the task
if task_frequency < 10:
# avoid flooding with too less delay
schedule.every(10).seconds.do(tasks.process)
else:
schedule.every(task_frequency).seconds.do(tasks.process)
# create instance of HeartBeat
ping = HeartBeat(__version__, CONFIG.get('server', 'server_port'))
# schedule the tasks
schedule.every(CONFIG.getint('bot', 'task_frequency')).seconds.do(tasks.process)
# schedule the task
schedule.every(12).hours.do(ping.process)

self.find_game_start()
Expand Down

0 comments on commit 93a613f

Please sign in to comment.