Closed camdendotlol closed 1 year ago
As discussed, let's also add a frequency
flag as an environment variable, so that we can set how often this should be run. This will assist in testing, so we can set dry_run
to true, and frequency to hourly, daily or weekly.
UPDATE:
Default for dry_run
to false
; if env var is present use that; if a command line flag is set either interactively or via cron job, that overrides env var.
Default for frequency
to weekly
, and midnight Sunday GMT; if env var is present use that. Value should include weekly
and daily
VETTED_DOC_DAY
variable: default: Sunday
, 00:00 GMT
hard coded, if frequency is daily, ignore day env var
What this PR does
This PR updates the
copy_vetted_documents
rake task with the following changes:bundle exec rake copy_vetted_documents
) will copy the vetted documents fromcove-studio
to all other tenants.ADMINS_TO_NOTIFY
environment variable.The task already checked for and ignored duplicates, so I didn't need to update that behavior for this PR.
The emails contain the same logging that appears in the console:
(in this screenshot, all documents are duplicates because I've run the task before, so they are all skipped)
UPDATE 11/1/22