🔃 🕘
This extension provides a option to refresh/reupload the datastore data when resource is uploaded by URL. Because there is no mechanism within CKAN core to track the changes in the files after the upload, we need to create cronjob that would call the CLI command to refresh data defined by the configuration panel as CKAN sysadmin.
Works with CKAN 2.9.x and above(python v3.7 and above).
Depends on ckanext-xloader
Compatibility with core CKAN versions:
CKAN version | Compatible? |
---|---|
2.9 | yes |
2.10 | yes |
To install ckanext-datastore-refresh:
-
Clone the source and install it on the virtualenv
git clone https://github.com/salsadigitalauorg/ckanext-datastore-refresh.git cd ckanext-datastore-refresh pip install -e .
-
Add
datastore_refresh
to theckan.plugins
setting in your CKAN config file. -
Apply DB migrations:
ckan db upgrade -p datastore_refresh
Configuration is done by the CKAN admin menu
@hourly ckan -c /path/to/ckan.ini datastore-refresh refresh_dataset_datastore 10
10 - frequency to refresh the datastore (in minutes) Cron jobs can be set by the desired frequency which currently is set to 10 min, 2 hours or 24 hours
#TODO: Make frequencies configurable via ckan.ini file
To run the tests, do:
pytest