Change order that the engine instantiates the DBBinder and the driver

18 views
Skip to first unread message

bell...@gmail.com

unread,
May 2, 2024, 11:35:48 AMMay 2
to weewx-development
Background:
I am experimenting with a driver/service pair that performs a ‘lightweight’ (Not sure a reliable synchronization can be light weight) synchronization of sqlite DBs over MQTT v5. When the driver is instantiated, it retrieves the ‘lastGoodStamp’ from the database. It then makes a MQTT request to the primary DB for all records since that timestamp. By the time genStartupRecords is called, the catchup data should (hopefully) be available. But, the DBBinder has not been instantiated yet. I can get around this using ‘weewx.manager.open_manager’.

I’m wondering if you would be open to a pull request that just moves ‘self.db_binder = weewx.manager.DBBinder(config_dict)’ prior to ‘ self.setupStation(config_dict)? Then when the driver retrieves the db_manager, it would be cached and available to the rest of the WeeWX pipeline/infrastructure.

Thanks. rich

Tom Keffer

unread,
May 2, 2024, 11:50:10 AMMay 2
to bell...@gmail.com, weewx-development
Sure! That sounds pretty reasonable.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/5e16890b-b3c3-41b2-aa79-f441dda52625n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages