You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@steve.apache.org by gs...@apache.org on 2025/10/07 12:43:59 UTC
(steve) 01/03: Restart if queries.yaml changes.
This is an automated email from the ASF dual-hosted git repository.
gstein pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/steve.git
commit 1f3ef94b8d67ac5ee423f4fda077eeeda69dd5ab
Author: Greg Stein <gs...@gmail.com>
AuthorDate: Mon Oct 6 19:41:03 2025 -0500
Restart if queries.yaml changes.
---
v3/server/main.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/v3/server/main.py b/v3/server/main.py
index 00353b2..77e0023 100755
--- a/v3/server/main.py
+++ b/v3/server/main.py
@@ -16,6 +16,7 @@
# limitations under the License.
#
+import sys
import logging
import pathlib
@@ -51,13 +52,24 @@ def main():
import pages # pylint: disable=unused-import
import api # pylint: disable=unused-import
+ # Note: "pages" imports "steve.election". Pull that package into
+ # our local namespace.
+ steve = sys.modules['steve']
+
+ # There are other things to watch, and cause a reload.
+ extra_files = {
+ steve.election.QUERIES,
+ }
+
kwargs = { }
if app.cfg.server.certfile:
kwargs['certfile'] = CERTS_DIR / app.cfg.server.certfile
kwargs['keyfile'] = CERTS_DIR / app.cfg.server.keyfile
# Spool up the app!
- app.runx(port=app.cfg.server.port, **kwargs)
+ app.runx(port=app.cfg.server.port,
+ extra_files=extra_files,
+ **kwargs)
#print('LOGGERS:', sorted(_LOGGER.manager.loggerDict.keys()))
#print(_LOGGER.manager.loggerDict['sslproto'])