-
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
1 parent
cc30c4b
commit 1f0294f
Showing
3 changed files
with
54 additions
and
14 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
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,32 @@ | ||
from redis import exceptions | ||
from rsmq import RedisSMQ | ||
|
||
|
||
REDIS_HOST = "127.0.0.1" | ||
REDIS_PORT = "6379" | ||
|
||
QUEUES_NAMES = "test_queue_1 test_queue_2" | ||
|
||
|
||
def delete_queues(): | ||
try: | ||
for queue_name in QUEUES_NAMES.split(): | ||
for suffix in ["_tasks", "_results"]: | ||
queue = RedisSMQ( | ||
host=REDIS_HOST, | ||
port=REDIS_PORT, | ||
qname=queue_name + suffix, | ||
quiet=False, | ||
) | ||
|
||
queue.deleteQueue().exceptions(False).execute() | ||
queue.createQueue(maxsize=-1).vt(120).exceptions(False).execute() | ||
|
||
print("Queues properly deleted") | ||
|
||
except exceptions.ConnectionError: | ||
print("No redis connection") | ||
|
||
|
||
if __name__ == "__main__": | ||
delete_queues() |
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