From be3461d4a5c3f106045afa05c801d3e48968ff90 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 13 Feb 2025 13:37:53 -0500 Subject: [PATCH] automated terminal push --- consumer.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/consumer.py b/consumer.py index 3841495..a8e7f05 100644 --- a/consumer.py +++ b/consumer.py @@ -2,6 +2,8 @@ import stomp import time import SullyGnomeRobot import RestAPIClient +import os +import signal print("## ") print("## starting > JMS consumer (yankee-sully-channels-monthly)") @@ -60,9 +62,10 @@ class MyListener(stomp.ConnectionListener): RestAPIClient.addDownloadFailure(message.body, "error from onmessage (consumer.py)") print("## ") -print("## starting > JMS consumer (yankee-sully-channels-monthly)") +print("## starting > (timed) JMS consumer (yankee-sully-channels-monthly)") print("## ") + conn = stomp.Connection([('67.220.70.106', 61613)]) conn.set_listener('', MyListener()) @@ -75,10 +78,24 @@ print("## ") print("## notification > connected to JMS server (yankee-sully-channels-monthly) 3333") print("## ") -while True: +start_time = time.time() + +print("start time /",start_time) + +counter=0 + +while time.time() - start_time < 60: + + counter = counter + 1 pass + print("waiting for 60 seconds of elapsed time: ",counter) + time.sleep(1) + +print("it's been 60 seconds. what up though?") conn.disconnect() + +print("disconnected from JMS. i'll holla!")