Closed Altonhe closed 4 months ago
The previous script does not ensure idempotent, for example, when you restart the container, it will check if TRIP_UPDATES_URL has been set, and insert the value into the data-source.xml, this will cause duplicate values, like this:
TRIP_UPDATES_URL
data-source.xml
<bean id="gtfsRT" class="org.onebusaway.transit_data_federation.impl.realtime.gtfs_realtime.GtfsRealtimeSource"> <property name="tripUpdatesUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_TripUpdates.pb"/> <property name="vehiclePositionsUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_VehiclePositions.pb"/> <property name="alertsUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_ServiceAlerts.pb"/> <property name="refreshInterval" value="30"/> <property name="agencyId" value="Burlington"/> <property name="tripUpdatesUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_TripUpdates.pb"/> <property name="vehiclePositionsUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_VehiclePositions.pb"/> <property name="alertsUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_ServiceAlerts.pb"/> <property name="refreshInterval" value="30"/> <property name="agencyId" value="Burlington"/> <property name="tripUpdatesUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_TripUpdates.pb"/> <property name="vehiclePositionsUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_VehiclePositions.pb"/> <property name="alertsUrl" value="https://opendata.burlington.ca/gtfs-rt/GTFS_ServiceAlerts.pb"/> <property name="refreshInterval" value="30"/> <property name="agencyId" value="Burlington"/> </bean>
this PR will ensure each config file will be the same no matter how many times the script is executed.
oops, just noticed this is still a draft. let me know when it's ready for review!
@aaronbrethorst I forgot to add the description of the PR, I will merge it if you don't mind
Sure go for it!
The previous script does not ensure idempotent, for example, when you restart the container, it will check if
TRIP_UPDATES_URL
has been set, and insert the value into thedata-source.xml
, this will cause duplicate values, like this:this PR will ensure each config file will be the same no matter how many times the script is executed.