improve cron job
This commit is contained in:
parent
4d23134372
commit
c947e7cbd5
6
cron.py
6
cron.py
|
@ -1040,7 +1040,7 @@ if __name__ == "__main__":
|
|||
help="Choose a cron job to run",
|
||||
type=str,
|
||||
choices=[
|
||||
"stats",
|
||||
"growth_stats",
|
||||
"daily_monitoring_report",
|
||||
"notify_trial_end",
|
||||
"notify_manual_subscription_end",
|
||||
|
@ -1057,8 +1057,8 @@ if __name__ == "__main__":
|
|||
args = parser.parse_args()
|
||||
# wrap in an app context to benefit from app setup like database cleanup, sentry integration, etc
|
||||
with create_light_app().app_context():
|
||||
if args.job == "stats":
|
||||
LOG.d("Compute Stats")
|
||||
if args.job == "growth_stats":
|
||||
LOG.d("Compute growth Stats")
|
||||
growth_stats()
|
||||
if args.job == "daily_monitoring_report":
|
||||
LOG.d("Send out daily monitoring stats")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
jobs:
|
||||
- name: SimpleLogin stats
|
||||
command: python /code/cron.py -j stats
|
||||
- name: SimpleLogin growth stats
|
||||
command: python /code/cron.py -j growth_stats
|
||||
shell: /bin/bash
|
||||
schedule: "0 1 * * *"
|
||||
captureStderr: true
|
||||
|
||||
- name: SimpleLogin stats
|
||||
- name: SimpleLogin monitoring stats
|
||||
command: python /code/cron.py -j daily_monitoring_report
|
||||
shell: /bin/bash
|
||||
schedule: "0 0 * * *"
|
||||
|
|
Loading…
Reference in New Issue