Unanswered
Hi,
I Am Try To Use Taskscheduler As Cronjob, I Want My Task Running Every 2.40 Am Utc Everyday,
Hi @<1523701205467926528:profile|AgitatedDove14> , Thanks for rresponse!
this my simple code to test scheduler
import datetime
from clearml.automation import TaskScheduler
def test_make():
print('test running', datetime.datetime.now())
if __name__ == '__main__':
task_scheduler = TaskScheduler(
sync_frequency_minutes=30,
force_create_task_name='controller_feedback',
force_create_task_project='Automation/Controller',
)
print('\n[utc_timestamp]:',datetime.datetime.utcnow())
print()
task_scheduler.add_task(
target_project='Automation/testing',
name='fetch feedback',
schedule_function=test_make,
minute=35, hour=4, day=1,
recurring=True,
)
print(task_scheduler.get_scheduled_tasks())
task_scheduler.start()
and the console output like this after pass the 4.35 utc time, there is no job running.
ClearML Task: created new task id=e9369778f9084929bee918f163f940a7
ClearML results page:
[utc_timestamp]: 2023-02-26 04:29:48.147570
[ScheduleJob(name='fetch feedback', base_task_id='', base_function=<function test_make at 0x7f91fd123d90>, queue=None, target_project='Automation/testing', single_instance=False, task_parameters=None, task_overrides=None, clone_task=True, _executed_instances=None, execution_limit_hours=None, recurring=True, starting_time=datetime.datetime(2023, 2, 26, 4, 29, 48, 148192), minute=35, hour=4, day=1, weekdays=None, month=None, year=None, _next_run=None, _execution_timeout=None, _last_executed=None)]
Syncing scheduler
Waiting for next run, sleeping for 30.00 minutes, until next sync.
clearml=1.9.1
188 Views
0
Answers
one year ago
one year ago