Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# CHANGELOG

## dev
- enh: improve garbage collection logic and increase sleep duration

## 0.5.0 (2025-03-20)
- enh: frontend updates

Expand Down
2 changes: 2 additions & 0 deletions proxy_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def garbage(self):
if time.time() - os.path.getmtime(file_path) > time_limit:
os.remove(file_path)
counter = counter + 1
if counter == 0:
return
print(f'Garbage collected {counter} files')

def _gen_path(self, content_hash: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def storage_garbage_task(app):
content_storage: ContentStorage = app.get('proxy_log').get_content_storage()
while True:
content_storage.garbage()
await asyncio.sleep(60)
await asyncio.sleep(600)


def run_proxy_server(environment: Environment, proxy_log: ProxyLog):
Expand Down