Unblock redis locks

This commit is contained in:
Kamil
2024-11-26 15:09:29 +00:00
parent 0fe45483dc
commit 16e1a8a58d
2 changed files with 26 additions and 3 deletions

View File

@@ -13,6 +13,14 @@ TASK_STATUS = {
'check_for_playlist_updates': None,
'update_jellyfin_id_for_downloaded_tracks' : None
}
LOCK_KEYS = [
'update_all_playlists_track_status_lock',
'download_missing_tracks_lock',
'check_for_playlist_updates_lock',
'update_jellyfin_id_for_downloaded_tracks_lock' ,
'full_update_jellyfin_ids'
]
def manage_task(task_name):
task_id = TASK_STATUS.get(task_name)

View File

@@ -1,8 +1,6 @@
{% extends "admin.html" %}
{% block admin_content %}
<div class="container mt-5">
<!-- Tabelle für den Task-Status -->
<table class="table">
<thead>
<tr>
@@ -12,10 +10,27 @@
<th>Action</th>
</tr>
</thead>
<!-- Das Partial wird dynamisch über HTMX geladen -->
<tbody id="task-status" hx-get="/task_status" hx-trigger="every 1s" hx-swap="innerHTML">
{% include 'partials/_task_status.html' %}
</tbody>
</table>
</div>
<div>
<form hx-post="/unlock_key" hx-swap="outerHTML" hx-target="#empty">
<div class="mb-3">
<label for="inputLockKey" class="form-label">Lock Key Name</label>
<select class="form-select form-select-lg mb-3" aria-label="Select task lock to unlock" id="inputLockKey" name="inputLockKey">
{% for value in lock_keys %}
<option value="{{value}}">{{value}}</option>
{% endfor %}
</select>
<div id="inputLockKeyHelp" class="form-text">Provide a key name to to reset a lock. </div>
</div>
<button type="submit" class="btn btn-primary">Unlock</button>
</form>
</div>
<div id="empty"></div>
{% endblock %}