-
Notifications
You must be signed in to change notification settings - Fork 0
GTFS-RT converter: switch to newly imported GTFS automatically #1
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, new GTFS datasets get imported automatically:
gtfs-rt-infrastructure/playbooks/gtfs-rt-converters.yml
Lines 107 to 114 in b08dd86
| - name: set up GTFS import cron job | |
| ansible.builtin.cron: | |
| name: 'gtfs-rt-feed: GTFS import' | |
| user: root # todo: use `www-data` instead? | |
| cron_file: gtfs-rt-feed-gtfs-import | |
| job: '{{ gtfs_rt_feed_import_cmd }}' | |
| # every hour | |
| minute: '3' |
gtfs-rt-infrastructure/group_vars/gtfs_rt_converter.yml
Lines 29 to 32 in b08dd86
| # This command imports the GTFS data into a database. It then writes a systemd override config file setting $PGDATABASE. | |
| # We assume that it is executed using `sh`. | |
| # todo: make $GTFS_IMPORTER_DB_PREFIX configurable | |
| gtfs_rt_feed_import_cmd: "export PGUSER=postgres PGPASSWORD='{{ postgresql_postgres_password }}' PGDATABASE='{{ gtfs_rt_feed_gtfs_importer_db }}' && env GTFS_DOWNLOAD_USER_AGENT='{{ gtfs_rt_feed_gtfs_download_user_agent }}' {{ gtfs_rt_feed_dir }}/import.sh --docker && echo \"[Service]\\nEnvironment=PGDATABASE=$(psql -q --csv -t -h localhost -c 'SELECT db_name FROM latest_import')\"| sponge /etc/systemd/system/gtfs-rt-feed.service.d/pgdatabase.conf" |
However, gtfs-rt-feed.service needs to be restarted afterwards to use the new data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request