Show More
@@ -54,9 +54,7 b' def safe_json(get, section, key):' | |||
|
54 | 54 | value = get(key) |
|
55 | 55 | json_value = json.loads(value) |
|
56 | 56 | except ValueError: |
|
57 |
msg = 'The |
|
|
58 | key, value, section | |
|
59 | ) | |
|
57 | msg = f'The {key}={value} is not valid json in section {section}' | |
|
60 | 58 | raise ValueError(msg) |
|
61 | 59 | |
|
62 | 60 | return json_value |
@@ -71,11 +69,7 b' def raw_2_schedule(schedule_value, sched' | |||
|
71 | 69 | scheduler_cls = schedule_type_map.get(schedule_type) |
|
72 | 70 | |
|
73 | 71 | if scheduler_cls is None: |
|
74 | raise ValueError( | |
|
75 | 'schedule type %s in section is invalid' % ( | |
|
76 | schedule_type, | |
|
77 | ) | |
|
78 | ) | |
|
72 | raise ValueError(f'schedule type {schedule_type} in section is invalid') | |
|
79 | 73 | try: |
|
80 | 74 | schedule = scheduler_cls(schedule_value) |
|
81 | 75 | except TypeError: |
@@ -5290,8 +5290,11 b' class ScheduleEntry(Base, BaseModel):' | |||
|
5290 | 5290 | UniqueConstraint('task_uid', name='s_task_uid_idx'), |
|
5291 | 5291 | base_table_args, |
|
5292 | 5292 | ) |
|
5293 | ||
|
5294 | schedule_types = ['crontab', 'timedelta', 'integer'] | |
|
5293 | SCHEDULE_TYPE_INTEGER = "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 | 5298 | schedule_entry_id = Column('schedule_entry_id', Integer(), primary_key=True) |
|
5296 | 5299 | |
|
5297 | 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