-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from redis import exceptions | ||
from rsmq import RedisSMQ | ||
|
||
REDIS_HOST = "127.0.0.1" | ||
REDIS_PORT = "6379" | ||
|
||
|
||
def delete_queues(): | ||
try: | ||
queue = RedisSMQ( | ||
host=REDIS_HOST, | ||
port=REDIS_PORT, | ||
qname="information_extraction_tasks", | ||
quiet=False, | ||
) | ||
|
||
queue.deleteQueue().exceptions(False).execute() | ||
queue.createQueue().exceptions(False).execute() | ||
|
||
queue = RedisSMQ( | ||
host=REDIS_HOST, | ||
port=REDIS_PORT, | ||
qname="information_extraction_results", | ||
quiet=False, | ||
) | ||
|
||
queue.deleteQueue().exceptions(False).execute() | ||
queue.createQueue().exceptions(False).execute() | ||
|
||
print("Queues properly deleted") | ||
|
||
except exceptions.ConnectionError: | ||
print("No redis connection") | ||
|
||
|
||
if __name__ == "__main__": | ||
delete_queues() |