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!")