forked from OCA/oca-github-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cron.py
34 lines (29 loc) · 1001 Bytes
/
cron.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (c) ACSONE SA/NV 2018
# Distributed under the MIT License (http://opensource.org/licenses/MIT).
from celery.schedules import crontab
from .config import GITHUB_ORG
from .queue import app
beat_schedule = {
"heartbeat": {
"task": "oca_github_bot.tasks.heartbeat.heartbeat",
"schedule": crontab(minute="*/15"),
}
}
if GITHUB_ORG:
beat_schedule.update(
{
"main_branch_bot_all_repos": {
"task": "oca_github_bot.tasks.main_branch_bot."
"main_branch_bot_all_repos",
"args": (GITHUB_ORG,),
"kwargs": dict(build_wheels=True),
"schedule": crontab(hour="2", minute="30"),
},
"tag_ready_to_merge": {
"task": "oca_github_bot.tasks.tag_ready_to_merge.tag_ready_to_merge",
"args": (GITHUB_ORG,),
"schedule": crontab(minute="0"),
},
}
)
app.conf.beat_schedule = beat_schedule