Mise à jour de 'synapse-cleaner.sh'

This commit is contained in:
Dryusdan 2020-09-05 17:35:05 +02:00
parent 5763bed56b
commit 0bf3288b3e
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,9 @@ source utils/log
source utils/config
#######################################################
function purge_imr{
/usr/bin/curl -X POST "${HS_URL}${API_URL}purge_media_cache?before_ts=$(($(date --date="1 month ago" +%s%N)/1000000))&access_token=${ACCESS_TOKEN}"
}
function get_room {
info "Get total room"
total_room=$(curl -s --header "Authorization: Bearer ${ACCESS_TOKEN}" "${HS_URL}${API_URL}rooms?limit=1" | jq --raw-output ".total_rooms")
@ -30,6 +33,7 @@ info "Starting at $(date)"
info "Create ${CLEAN_FOLDER}"
mkdir -p "${CLEAN_FOLDER}"
purge_img
get_room
get_purge
info "Pruning empty room"