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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user