##// END OF EJS Templates
small changes for scheduler fixes of EE edition
super-admin -
r5138:14e25636 default
parent child Browse files
Show More
@@ -54,9 +54,7 b' def safe_json(get, section, key):'
54 value = get(key)
54 value = get(key)
55 json_value = json.loads(value)
55 json_value = json.loads(value)
56 except ValueError:
56 except ValueError:
57 msg = 'The %s=%s is not valid json in section %s' % (
57 msg = f'The {key}={value} is not valid json in section {section}'
58 key, value, section
59 )
60 raise ValueError(msg)
58 raise ValueError(msg)
61
59
62 return json_value
60 return json_value
@@ -71,11 +69,7 b' def raw_2_schedule(schedule_value, sched'
71 scheduler_cls = schedule_type_map.get(schedule_type)
69 scheduler_cls = schedule_type_map.get(schedule_type)
72
70
73 if scheduler_cls is None:
71 if scheduler_cls is None:
74 raise ValueError(
72 raise ValueError(f'schedule type {schedule_type} in section is invalid')
75 'schedule type %s in section is invalid' % (
76 schedule_type,
77 )
78 )
79 try:
73 try:
80 schedule = scheduler_cls(schedule_value)
74 schedule = scheduler_cls(schedule_value)
81 except TypeError:
75 except TypeError:
@@ -5290,8 +5290,11 b' class ScheduleEntry(Base, BaseModel):'
5290 UniqueConstraint('task_uid', name='s_task_uid_idx'),
5290 UniqueConstraint('task_uid', name='s_task_uid_idx'),
5291 base_table_args,
5291 base_table_args,
5292 )
5292 )
5293
5293 SCHEDULE_TYPE_INTEGER = "integer"
5294 schedule_types = ['crontab', 'timedelta', 'integer']
5294 SCHEDULE_TYPE_CRONTAB = "crontab"
5295 SCHEDULE_TYPE_TIMEDELTA = "timedelta"
5296
5297 schedule_types = [SCHEDULE_TYPE_CRONTAB, SCHEDULE_TYPE_TIMEDELTA, SCHEDULE_TYPE_INTEGER]
5295 schedule_entry_id = Column('schedule_entry_id', Integer(), primary_key=True)
5298 schedule_entry_id = Column('schedule_entry_id', Integer(), primary_key=True)
5296
5299
5297 schedule_name = Column("schedule_name", String(255), nullable=False, unique=None, default=None)
5300 schedule_name = Column("schedule_name", String(255), nullable=False, unique=None, default=None)
General Comments 0
You need to be logged in to leave comments. Login now