From 86fb988054ebe6546de8465551481cae02c54362 Mon Sep 17 00:00:00 2001 From: Jonathan Feist Date: Thu, 9 Dec 2021 15:59:42 +0000 Subject: [PATCH] fix: do not trigger redlist species timestamp automatically --- CHANGELOG.md | 5 +++++ README.md | 6 ++++++ lib/tasks/import_new_redlist_data.rake | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd2b612..4bb87bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.4.1 + +* Do not automatically update the Redlist species timestamp. +* Add docs in readme on how to trigger a timestamp update. + ## 1.4.0 * Automate update of Redlist Species last updated timestamp by using a dotfile diff --git a/README.md b/README.md index 453ac123..00f9bbd3 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,9 @@ fails for some reason. The deployment TASK hook has this functionality. * Ensure you have the latest `main` with `git checkout main; git pull origin main` * Deploy with `bundle exec cap production deploy TASK=import:refresh` + +## Update Redlist species timestamp + +To update the timestmap, just run `bundle exec rake import:update_redlist_timestamp` +on the server. You can also run `bundle exec cap production deploy TASK=import:update_redlist_timestamp` +to do this from your own machine, but it will include a new deploy. \ No newline at end of file diff --git a/lib/tasks/import_new_redlist_data.rake b/lib/tasks/import_new_redlist_data.rake index 0224eff6..5c56c7b7 100644 --- a/lib/tasks/import_new_redlist_data.rake +++ b/lib/tasks/import_new_redlist_data.rake @@ -11,7 +11,6 @@ namespace :import do import_for_countries import_for_regions end - RedlistSpeciesLastUpdated.touch! end desc 'import habitats occurrences' @@ -27,6 +26,11 @@ namespace :import do end end + desc 'update Redlist species last updated timestamp' + task update_redlist_timestamp: [:environment] do + RedlistSpeciesLastUpdated.touch! + end + def import_for_countries species_filename = 'lib/data/iucn_redlist/country_species.csv' prev_iso = nil