Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/origin_save.py
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | def can_save_origin(origin_url): | ||||
for url_prefix in get_origin_save_authorized_urls(): | for url_prefix in get_origin_save_authorized_urls(): | ||||
if origin_url.startswith(url_prefix): | if origin_url.startswith(url_prefix): | ||||
return SAVE_REQUEST_ACCEPTED | return SAVE_REQUEST_ACCEPTED | ||||
# otherwise, the origin url needs to be manually verified | # otherwise, the origin url needs to be manually verified | ||||
return SAVE_REQUEST_PENDING | return SAVE_REQUEST_PENDING | ||||
# map origin type to scheduler task | # map origin type to scheduler task | ||||
# TODO: do not hardcode the task name here | # TODO: do not hardcode the task name here (T1157) | ||||
douardda: remove these comments and we will be good | |||||
# TODO: unlock hg and svn loading once the scheduler | |||||
# loading tasks are available in production | |||||
_origin_type_task = { | _origin_type_task = { | ||||
'git': 'origin-update-git', | 'git': 'load-git', | ||||
# 'hg': 'origin-load-hg', | 'hg': 'load-hg', | ||||
# 'svn': 'origin-load-svn' | 'svn': 'load-svn' | ||||
} | } | ||||
# map scheduler task status to origin save status | # map scheduler task status to origin save status | ||||
_save_task_status = { | _save_task_status = { | ||||
'next_run_not_scheduled': SAVE_TASK_NOT_YET_SCHEDULED, | 'next_run_not_scheduled': SAVE_TASK_NOT_YET_SCHEDULED, | ||||
'next_run_scheduled': SAVE_TASK_SCHEDULED, | 'next_run_scheduled': SAVE_TASK_SCHEDULED, | ||||
'completed': SAVE_TASK_SUCCEED, | 'completed': SAVE_TASK_SUCCEED, | ||||
▲ Show 20 Lines • Show All 302 Lines • Show Last 20 Lines |
remove these comments and we will be good