cleanup
This commit is contained in:
21
bitbylaw/scripts/calendar_sync/delete_employee_locks.py
Normal file
21
bitbylaw/scripts/calendar_sync/delete_employee_locks.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import redis
|
||||
from config import Config
|
||||
|
||||
def main():
|
||||
redis_client = redis.Redis(
|
||||
host=Config.REDIS_HOST,
|
||||
port=int(Config.REDIS_PORT),
|
||||
db=int(Config.REDIS_DB_CALENDAR_SYNC),
|
||||
socket_timeout=Config.REDIS_TIMEOUT_SECONDS
|
||||
)
|
||||
|
||||
# Find all lock keys
|
||||
lock_keys = redis_client.keys('calendar_sync_lock_*')
|
||||
if lock_keys:
|
||||
deleted_count = redis_client.delete(*lock_keys)
|
||||
print(f"Deleted {deleted_count} employee lock keys.")
|
||||
else:
|
||||
print("No employee lock keys found.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user