Replace asyncio.to_thread with ThreadPoolExecutor.run_in_executor

- Add ThreadPoolExecutor with 3 max workers to SeriesApp
- Replace all asyncio.to_thread calls with loop.run_in_executor
- Add shutdown() method to properly cleanup executor
- Integrate SeriesApp.shutdown() into FastAPI shutdown sequence
- Ensures proper resource cleanup on Ctrl+C (SIGINT/SIGTERM)
This commit is contained in:
2026-01-03 21:04:52 +01:00
parent b1726968e5
commit ab7d78261e
6 changed files with 102 additions and 329 deletions

View File

@@ -17,7 +17,7 @@
"keep_days": 30
},
"other": {
"master_password_hash": "$pbkdf2-sha256$29000$LkUohZASQmgthdD6n9Nayw$6VmJzv/pYSdyW7..eU57P.YJpjK/6fXvXvef0L6PLDg",
"master_password_hash": "$pbkdf2-sha256$29000$kxLi/J9zTukdA6BUitHa.w$tLseUX7kHXkjl3N9pFAd2Y.dzveyx0buInX7Wu9MHLg",
"anime_directory": "/mnt/server/serien/Serien/"
},
"version": "1.0.0"

View File

@@ -0,0 +1,24 @@
{
"name": "Aniworld",
"data_dir": "data",
"scheduler": {
"enabled": true,
"interval_minutes": 60
},
"logging": {
"level": "INFO",
"file": null,
"max_bytes": null,
"backup_count": 3
},
"backup": {
"enabled": false,
"path": "data/backups",
"keep_days": 30
},
"other": {
"master_password_hash": "$pbkdf2-sha256$29000$X4uRMibE.N.bM.acs1ZKSQ$88em69lhlaLiS6vcF9oqf4pCC8KBbIj/O3h4cQFwM.I",
"anime_directory": "/mnt/server/serien/Serien/"
},
"version": "1.0.0"
}

View File

@@ -0,0 +1,24 @@
{
"name": "Aniworld",
"data_dir": "data",
"scheduler": {
"enabled": true,
"interval_minutes": 60
},
"logging": {
"level": "INFO",
"file": null,
"max_bytes": null,
"backup_count": 3
},
"backup": {
"enabled": false,
"path": "data/backups",
"keep_days": 30
},
"other": {
"master_password_hash": "$pbkdf2-sha256$29000$TQlBSOndm1MKAWAMoTRGKA$a/q5miowGpjWSc71WDvqBpL9JJmuAO1FrZlCi3qwp2E",
"anime_directory": "/mnt/server/serien/Serien/"
},
"version": "1.0.0"
}