Skip to content

Commit

Permalink
Improve documentation and add 5 min
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlucas committed Sep 30, 2022
1 parent 7d6f1e2 commit 5d141b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions webservices/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
schedule = {}
if env.app.get("space_name", "unknown-space").lower() != "feature":
schedule = {
# Task 1: This task is launched every 5 minutes during 6am-7pmEST(13 hours).
# Task 1: This task is launched every 5 minutes during 10am-23:55pm UTC (6am-7:55pm EST) (13 hours + 55 minutes).
# Task 1A: refresh_most_recent_aos(conn):
# 1) Identify the most recently modified AO(s) within 8 hours
# 1) Identify the most recently modified AO(s) within 10 hours and 5 minutes
# 2) For each modified AO, find the earliest AO referenced by the modified AO
# 3) Reload all AO(s) starting from the referenced AO to the latest AO.

# Task 1B: refresh_most_recent_cases(conn):
# When found modified case(s)(MUR/AF/ADR) within 8 hours,
# When found modified case(s)(MUR/AF/ADR) within 10 hours and 5 minutes,
# if published_flg = true, reload the case(s) on elasticsearch service.
# if published_flg = false, delete the case(s) on elasticsearch service.
"refresh_legal_docs": {
Expand All @@ -39,11 +39,11 @@
"task": "webservices.tasks.legal_docs.weekly_reload_all_aos",
"schedule": crontab(minute=0, hour=1, day_of_week="sun"),
},
# Task 4: This task is launched at 6pm(EST) everyday.
# When found modified case(s)(MUR/AF/ADR) in past 13 hours(6am-7pm EST), send case detail information to Slack.
# Task 4: This task is launched at 7:55pm(EST) everyday.
# When found modified case(s)(MUR/AF/ADR) in past 13 hours + 55 minutes (6am-7:55pm EST), send case detail information to Slack.
"send_alert_legal_case": {
"task": "webservices.tasks.legal_docs.send_alert_daily_modified_legal_case",
"schedule": crontab(minute=0, hour=23),
"schedule": crontab(minute=55, hour=23),
},
# Task 5: This task is launched at 12am(EST) only on Sunday.
# Take Elasticsearch 'docs' index snapshot.
Expand Down
4 changes: 2 additions & 2 deletions webservices/tasks/legal_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
RECENTLY_MODIFIED_AOS = """
SELECT ao_no, pg_date
FROM aouser.aos_with_parsed_numbers
WHERE pg_date >= NOW() - '10 hour'::INTERVAL
WHERE pg_date >= NOW() - '10 hours + 5 minutes'::INTERVAL
ORDER BY ao_year, ao_serial;
"""

RECENTLY_MODIFIED_CASES = """
SELECT case_no, case_type, pg_date, published_flg
FROM fecmur.cases_with_parsed_case_serial_numbers_vw
WHERE pg_date >= NOW() - '10 hour'::INTERVAL
WHERE pg_date >= NOW() - '10 hours + 5 minutes'::INTERVAL
ORDER BY case_serial;
"""

Expand Down

0 comments on commit 5d141b6

Please sign in to comment.