20 lines
462 B
Python
20 lines
462 B
Python
import time
|
|
|
|
from core.execution.operation import buildOperation
|
|
from core.execution.action import buildAction
|
|
from core import executeContract
|
|
|
|
def manageLifecycle(module, state):
|
|
print(state)
|
|
|
|
if state["mode"] == "continuous":
|
|
while state["mode"] == "continuous":
|
|
outputs = executeContract(module)
|
|
|
|
time.sleep(module.sleeptime)
|
|
|
|
elif state["mode"] == "oneshot":
|
|
outputs = executeContract(module)
|
|
|
|
return
|