performant-software / Annotation-Studio

An online annotation platform for teaching and learning in the humanities.
http://www.annotationstudio.org
GNU General Public License v2.0
4 stars 1 forks source link

Update vetted documents task to allow copying to all tenants and email notifications #435

Closed camdendotlol closed 1 year ago

camdendotlol commented 1 year ago

What this PR does

This PR updates the copy_vetted_documents rake task with the following changes:

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: Screen Shot 2022-08-31 at 4 10 52 PM (in this screenshot, all documents are duplicates because I've run the task before, so they are all skipped)

UPDATE 11/1/22

jamiefolsom commented 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