[Tile-serving] [openstreetmap/osm2pgsql] add a 'status' command which prints the lag (& in JSON) (#1548)

Amanda notifications at github.com
Tue Aug 17 11:58:09 UTC 2021


@amandasaurus commented on this pull request.



> +            LOG.fatal(results['error']['text']['en'])
+            return results['error']['code']
+
+        LOG.info("Using replication service '%s'. Current sequence %d (%s).",
+                 results['server']['base_url'], results['local']['sequence'], results['local']['timestamp'])
+        LOG.info("Server is at sequence %d (%s)", results['server']['sequence'], results['server']['timestamp'])
+        LOG.info("Server's most recent data is %s old", results['server']['age']['text']['en'])
+
+        if results['local']['sequence'] == results['server']['sequence']:
+            LOG.info("Database is up to date with server")
+        else:
+            LOG.info("Database is %d sequences behind, i.e. %s",
+                    results['diff']['sequence'],
+                    results['diff']['timestamp']['text']['en'])
+
+        LOG.info("Database's most recent data is %s old", results['local']['age']['text']['en'])

For the JSON output, it does use `print(…)`. For the default "human readable format", it uses `LOG.info/fatal`

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1548#discussion_r690299771
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20210817/92238718/attachment.htm>


More information about the Tile-serving mailing list