v1 server and lifecycle manager working. execution contract added
This commit is contained in:
@@ -0,0 +1 @@
|
||||
from . import manager
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
from datetime import datetime
|
||||
from core.operation.operation import buildOperation
|
||||
|
||||
def buildManager(definition):
|
||||
operations = definition.operations
|
||||
|
||||
current_time = datetime.now().time()
|
||||
|
||||
for operation in operations:
|
||||
if hasattr(operation, "role") and operation.role == "activate":
|
||||
if definition.uptime <= current_time <= definition.downtime:
|
||||
while True:
|
||||
current_time = datetime.now().time()
|
||||
outputs = buildOperation(operation)
|
||||
|
||||
if hasattr(operation, "role") and operation.role == "deactivate":
|
||||
if definition.downtime <= current_time <= definition.uptime:
|
||||
while True:
|
||||
current_time = datetime.now().time()
|
||||
outputs = buildOperation(operation)
|
||||
|
||||
# if hasattr(operation, "role") and role == offline:
|
||||
# outputs = buildOperation(operation)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user