fix prometheus starting height

This commit is contained in:
Jack Robison 2022-03-25 12:33:43 -04:00
parent ccc76bdd8e
commit 909ea901e4
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 3 additions and 0 deletions

View file

@ -357,6 +357,8 @@ class ElasticSyncService(BlockchainReaderService):
yield self.start_cancellable(self.run_es_notifier) yield self.start_cancellable(self.run_es_notifier)
yield self.reindex(force=self._force_reindex) yield self.reindex(force=self._force_reindex)
yield self.catch_up() yield self.catch_up()
self.block_count_metric.set(self.last_state.height)
yield self.start_prometheus()
yield self.start_cancellable(self.refresh_blocks_forever) yield self.start_cancellable(self.refresh_blocks_forever)
def _iter_stop_tasks(self): def _iter_stop_tasks(self):

View file

@ -92,6 +92,7 @@ class HubServerService(BlockchainReaderService):
yield self.start_cancellable(self.es_notification_client.maintain_connection) yield self.start_cancellable(self.es_notification_client.maintain_connection)
yield self.start_cancellable(self.refresh_blocks_forever) yield self.start_cancellable(self.refresh_blocks_forever)
yield self.finished_initial_catch_up.wait() yield self.finished_initial_catch_up.wait()
self.block_count_metric.set(self.last_state.height)
yield self.start_prometheus() yield self.start_prometheus()
yield self.start_cancellable(self.receive_es_notifications) yield self.start_cancellable(self.receive_es_notifications)
yield self.session_manager.search_index.start() yield self.session_manager.search_index.start()