Added --quiet option to refresh_project_links mgmt command
This commit is contained in:
parent
ce242e1de3
commit
73bb125e7b
@ -102,7 +102,8 @@ logging.getLogger('werkzeug').setLevel(logging.INFO)
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
log.setLevel(logging.DEBUG if app.config['DEBUG'] else logging.INFO)
|
log.setLevel(logging.DEBUG if app.config['DEBUG'] else logging.INFO)
|
||||||
log.info('Pillar starting, debug=%s', app.config['DEBUG'])
|
if app.config['DEBUG']:
|
||||||
|
log.info('Pillar starting, debug=%s', app.config['DEBUG'])
|
||||||
|
|
||||||
bugsnag.configure(
|
bugsnag.configure(
|
||||||
api_key=app.config['BUGSNAG_API_KEY'],
|
api_key=app.config['BUGSNAG_API_KEY'],
|
||||||
@ -356,7 +357,6 @@ def after_replacing_user(item, original):
|
|||||||
"""Push an update to the Algolia index when a user item is updated"""
|
"""Push an update to the Algolia index when a user item is updated"""
|
||||||
algolia_index_user_save(item)
|
algolia_index_user_save(item)
|
||||||
|
|
||||||
|
|
||||||
app.on_post_GET_users += post_GET_user
|
app.on_post_GET_users += post_GET_user
|
||||||
app.on_replace_users += after_replacing_user
|
app.on_replace_users += after_replacing_user
|
||||||
|
|
||||||
|
@ -644,11 +644,17 @@ def subscribe_node_owners():
|
|||||||
|
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def refresh_project_links(project, chunk_size=50):
|
def refresh_project_links(project, chunk_size=50, quiet=False):
|
||||||
"""Regenerates almost-expired file links for a certain project."""
|
"""Regenerates almost-expired file links for a certain project."""
|
||||||
|
|
||||||
chunk_size = int(chunk_size) # CLI parameters are passed as strings
|
if quiet:
|
||||||
|
import logging
|
||||||
|
from application import log
|
||||||
|
|
||||||
|
logging.getLogger().setLevel(logging.WARNING)
|
||||||
|
log.setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
chunk_size = int(chunk_size) # CLI parameters are passed as strings
|
||||||
from application.modules import file_storage
|
from application.modules import file_storage
|
||||||
file_storage.refresh_links_for_project(project, chunk_size, 2 * 3600)
|
file_storage.refresh_links_for_project(project, chunk_size, 2 * 3600)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user