swingmusic/app/periodic_scan.py
mungai-njoroge 1eac009fde prevent running migrations if is_fresh_install
+ fix: sqlite3.ProgrammingError: Cannot operate on a closed cursor on ProcessAlbumColors()
+ move processing artist images from periodic_scans to Populate
+ bump hash string limit from 7 to 10
+ add last_mod property to database
+ fix: TypeError: '<' not supported between instances of 'int' and 'str' on album page
2023-06-20 16:34:56 +03:00

32 lines
731 B
Python

"""
This module contains functions for the server
"""
import time
from app.logger import log
from app.lib.populate import Populate, PopulateCancelledError
from app.utils.generators import get_random_str
from app.utils.network import Ping
from app.utils.threading import background
from app.settings import ParserFlags, get_flag, get_scan_sleep_time
@background
def run_periodic_scans():
"""
Runs periodic scans.
"""
# ValidateAlbumThumbs()
# ValidatePlaylistThumbs()
while get_flag(ParserFlags.DO_PERIODIC_SCANS):
try:
Populate(key=get_random_str())
except PopulateCancelledError:
pass
sleep_time = get_scan_sleep_time()
time.sleep(sleep_time)