close at the end

This commit is contained in:
2021-04-25 13:11:10 +02:00
parent bc9d2493a9
commit b69d6032b2
3 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,6 @@ try:
channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True)
channel.start_consuming()
except KeyboardInterrupt:
connection.close()
dt = {}
for datetime in DATETIMES:
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
@ -33,3 +32,4 @@ except KeyboardInterrupt:
dt[dts] +=1
for key in dt:
print(key,",",dt[key])
connection.close()