mirror of
https://github.com/Lost-MSth/Arcaea-server.git
synced 2026-02-06 23:57:50 +08:00
[Bug fix] Update error & About bundle download
- Data for Arcaea 5.8.0 - Fix a bug that the server's database updates from an old version may meet a challenge if `recent30` table has some strange data. - Fix the issue where the bundle downloading memory cache does not clean up. - Add a config term to only change the X-Accel-Redirect prefix for bundle downloading.
This commit is contained in:
@@ -226,6 +226,8 @@ class BundleDownload:
|
||||
if not sql_list:
|
||||
return []
|
||||
|
||||
self.clear_expired_token()
|
||||
|
||||
self.c_m.executemany(
|
||||
'''insert into bundle_download_token values (?, ?, ?, ?)''', sql_list)
|
||||
|
||||
@@ -246,3 +248,7 @@ class BundleDownload:
|
||||
f'Too many content bundle downloads, IP: {ip}, DeviceID: {device_id}', status=429)
|
||||
|
||||
return file_path
|
||||
|
||||
def clear_expired_token(self) -> None:
|
||||
self.c_m.execute(
|
||||
'''delete from bundle_download_token where time < ?''', (int(time() - Constant.BUNDLE_DOWNLOAD_TIME_GAP_LIMIT),))
|
||||
|
||||
Reference in New Issue
Block a user