Skip to content

Commit

Permalink
script to empty redis tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
konzz committed Apr 26, 2024
1 parent a47f7cc commit 3f9b62f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions delete_queques.py
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()

0 comments on commit 3f9b62f

Please sign in to comment.