kagemomiji / airsonic-advanced

airsonic-advanced
GNU General Public License v3.0
152 stars 14 forks source link

[Feature Request]: Add Timeout Mechanism for Library Scan #238

Closed kagemomiji closed 1 year ago

kagemomiji commented 1 year ago

Scope

Other

What problem

Related with #230

I suspect that the library scan is causing an infinite loop and consuming 100% CPU usage. To address this, I propose adding a timeout setting to the library scan.

Feature

To ensure fail-safe operation, we need to implement a timeout mechanism.

The timeout duration will be determined based on whether Full Scan is enabled or not. By default, Full Scan will have a timeout of 1 hour, while non-Full Scan will have a timeout of 10 minutes.

To configure these settings, the following environment variables will be used:

AIRSONIC_SCAN_FULLTIMEOUT: Timeout duration in minutes for Full Scan. AIRSONIC_SCAN_TIMEOUT: Timeout duration in minutes for regular scans.