SIENTIAPDE-1094
Update settings for language services, adjust simulator port, enhance error handling in ingestor, and refine Redis feeder script
This commit is contained in:
@@ -16,14 +16,21 @@ POD_ID = os.getenv("HOSTNAME", "localhost")
|
||||
def main():
|
||||
start_prometheus_server()
|
||||
ingestor = Ingestor()
|
||||
ingestor.prepare_ingestor()
|
||||
try:
|
||||
ingestor.prepare_ingestor()
|
||||
except Exception as e:
|
||||
metrics.APP_ERRORS_TOTAL.labels(
|
||||
pod_id=POD_ID).inc() # Increment errors
|
||||
print(f"Failed to prepare ingestor: {e}")
|
||||
exit_signal.set()
|
||||
ingestor.logger.info("Ingestor prepared. Starting main loop.")
|
||||
|
||||
while not exit_signal.is_set():
|
||||
start_time = time() # Start loop timer
|
||||
try:
|
||||
ingestor.loop()
|
||||
metrics.APP_LOOP_COUNT.labels(pod_id=POD_ID).inc() # Increment loop counter
|
||||
metrics.APP_LOOP_COUNT.labels(
|
||||
pod_id=POD_ID).inc() # Increment loop counter
|
||||
|
||||
exit_signal.wait(ingestor.poll_interval)
|
||||
|
||||
@@ -33,7 +40,8 @@ def main():
|
||||
except Exception:
|
||||
print("Exception in main loop. Setting exit_signal flag.")
|
||||
traceback.print_exc()
|
||||
metrics.APP_ERRORS_TOTAL.labels(pod_id=POD_ID).inc() # Increment errors
|
||||
metrics.APP_ERRORS_TOTAL.labels(
|
||||
pod_id=POD_ID).inc() # Increment errors
|
||||
exit_signal.set()
|
||||
finally:
|
||||
# Record loop duration
|
||||
|
||||
Reference in New Issue
Block a user