Added manage.py command to refresh (almost) expired links.

manage.py refresh_project_links  5672beecc0261b2005ed1a33 -c 4

This refreshes the oldest 4 links of that project.
This commit is contained in:
2016-04-01 13:03:27 +02:00
parent c13fca4f30
commit ce242e1de3
6 changed files with 156 additions and 9 deletions

View File

@@ -643,5 +643,15 @@ def subscribe_node_owners():
after_inserting_nodes([n])
@manager.command
def refresh_project_links(project, chunk_size=50):
"""Regenerates almost-expired file links for a certain project."""
chunk_size = int(chunk_size) # CLI parameters are passed as strings
from application.modules import file_storage
file_storage.refresh_links_for_project(project, chunk_size, 2 * 3600)
if __name__ == '__main__':
manager.run()