Worlcup module: add a timeout to urlopen to avoid infinite event
This commit is contained in:
parent
ba1b5774bb
commit
82198160fd
@ -16,7 +16,7 @@ def load(context):
|
|||||||
add_hook("cmd_hook", Hook(cmd_worldcup, "worldcup"))
|
add_hook("cmd_hook", Hook(cmd_worldcup, "worldcup"))
|
||||||
|
|
||||||
from event import ModuleEvent
|
from event import ModuleEvent
|
||||||
add_event(ModuleEvent(func=lambda url: urlopen(url).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, intervalle=30))
|
add_event(ModuleEvent(func=lambda url: urlopen(url, timeout=10).read().decode(), func_data=API_URL % "matches/current?by_date=DESC", call=current_match_new_action, intervalle=30))
|
||||||
|
|
||||||
|
|
||||||
def help_tiny ():
|
def help_tiny ():
|
||||||
|
Loading…
Reference in New Issue
Block a user