close at the end
This commit is contained in:
parent
bc9d2493a9
commit
b69d6032b2
@ -27,3 +27,4 @@ except KeyboardInterrupt:
|
|||||||
dt[dts] +=1
|
dt[dts] +=1
|
||||||
for key in dt:
|
for key in dt:
|
||||||
print(key,",",dt[key])
|
print(key,",",dt[key])
|
||||||
|
consumer.close()
|
||||||
|
@ -23,7 +23,6 @@ try:
|
|||||||
channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True)
|
channel.basic_consume(queue=queue_name, on_message_callback=callback, auto_ack=True)
|
||||||
channel.start_consuming()
|
channel.start_consuming()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
connection.close()
|
|
||||||
dt = {}
|
dt = {}
|
||||||
for datetime in DATETIMES:
|
for datetime in DATETIMES:
|
||||||
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
|
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
|
||||||
@ -33,3 +32,4 @@ except KeyboardInterrupt:
|
|||||||
dt[dts] +=1
|
dt[dts] +=1
|
||||||
for key in dt:
|
for key in dt:
|
||||||
print(key,",",dt[key])
|
print(key,",",dt[key])
|
||||||
|
connection.close()
|
||||||
|
@ -17,7 +17,6 @@ try:
|
|||||||
m = socket.recv_string()
|
m = socket.recv_string()
|
||||||
DATETIMES.append(datetime.now())
|
DATETIMES.append(datetime.now())
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
socket.close()
|
|
||||||
dt = {}
|
dt = {}
|
||||||
for datetime in DATETIMES:
|
for datetime in DATETIMES:
|
||||||
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
|
dts = datetime.strftime("%m/%d/%Y, %H:%M:%S")
|
||||||
@ -27,3 +26,4 @@ except KeyboardInterrupt:
|
|||||||
dt[dts] +=1
|
dt[dts] +=1
|
||||||
for key in dt:
|
for key in dt:
|
||||||
print(key,",",dt[key])
|
print(key,",",dt[key])
|
||||||
|
socket.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user