[modules] Adjust update schedules
Make a few modules update more seldomly, to reduce CPU consumption.
This commit is contained in:
parent
0f6dfb3f1a
commit
18154dd74f
7 changed files with 24 additions and 12 deletions
|
@ -1,11 +1,11 @@
|
|||
import util.format
|
||||
|
||||
def every(minutes=0, seconds=0):
|
||||
def every(hours=0, minutes=0, seconds=0):
|
||||
def decorator_init(init):
|
||||
def call_init(obj, *args, **kwargs):
|
||||
init(obj, *args, **kwargs)
|
||||
if obj.parameter('interval') is None:
|
||||
obj.set('interval', minutes*60 + seconds)
|
||||
obj.set('interval', hours*3600 + minutes*60 + seconds)
|
||||
return call_init
|
||||
return decorator_init
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue