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