kopia lustrzana https://github.com/OpenDroneMap/WebODM
Added max-requests, reduced log output, timing tweak in scheduling operation
rodzic
a77854888e
commit
4408fc6ad2
|
@ -26,7 +26,6 @@ def boot():
|
||||||
|
|
||||||
booted.value = True
|
booted.value = True
|
||||||
logger = logging.getLogger('app.logger')
|
logger = logging.getLogger('app.logger')
|
||||||
logger.info("Booting...")
|
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
logger.warning("Debug mode is ON (for development this is OK)")
|
logger.warning("Debug mode is ON (for development this is OK)")
|
||||||
|
|
|
@ -16,7 +16,7 @@ from app.background import background
|
||||||
|
|
||||||
logger = logging.getLogger('app.logger')
|
logger = logging.getLogger('app.logger')
|
||||||
scheduler = BackgroundScheduler({
|
scheduler = BackgroundScheduler({
|
||||||
'apscheduler.job_defaults.coalesce': 'false',
|
'apscheduler.job_defaults.coalesce': 'true',
|
||||||
'apscheduler.job_defaults.max_instances': '3',
|
'apscheduler.job_defaults.max_instances': '3',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@ def process_pending_tasks():
|
||||||
Q(Q(status=None) | Q(status__in=[status_codes.QUEUED, status_codes.RUNNING]), processing_node__isnull=False) |
|
Q(Q(status=None) | Q(status__in=[status_codes.QUEUED, status_codes.RUNNING]), processing_node__isnull=False) |
|
||||||
Q(pending_action__isnull=False)).exclude(Q(processing_lock=True))
|
Q(pending_action__isnull=False)).exclude(Q(processing_lock=True))
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
logger.info("Acquiring lock: {}".format(task))
|
|
||||||
task.processing_lock = True
|
task.processing_lock = True
|
||||||
task.save()
|
task.save()
|
||||||
finally:
|
finally:
|
||||||
|
@ -80,12 +79,11 @@ def cleanup_projects():
|
||||||
logger.info("Deleted {} projects".format(count_dict['app.Project']))
|
logger.info("Deleted {} projects".format(count_dict['app.Project']))
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
logger.info("Starting background scheduler...")
|
|
||||||
try:
|
try:
|
||||||
scheduler.start()
|
scheduler.start()
|
||||||
scheduler.add_job(update_nodes_info, 'interval', seconds=30)
|
scheduler.add_job(update_nodes_info, 'interval', seconds=30)
|
||||||
scheduler.add_job(process_pending_tasks, 'interval', seconds=5)
|
scheduler.add_job(process_pending_tasks, 'interval', seconds=5)
|
||||||
scheduler.add_job(cleanup_projects, 'interval', seconds=15)
|
scheduler.add_job(cleanup_projects, 'interval', seconds=60)
|
||||||
except SchedulerAlreadyRunningError:
|
except SchedulerAlreadyRunningError:
|
||||||
logger.warning("Scheduler already running (this is OK while testing)")
|
logger.warning("Scheduler already running (this is OK while testing)")
|
||||||
|
|
||||||
|
|
2
start.sh
2
start.sh
|
@ -113,7 +113,7 @@ else
|
||||||
congrats
|
congrats
|
||||||
|
|
||||||
nginx -c $(pwd)/nginx/$conf
|
nginx -c $(pwd)/nginx/$conf
|
||||||
gunicorn webodm.wsgi --bind unix:/tmp/gunicorn.sock --timeout 360 --preload
|
gunicorn webodm.wsgi --bind unix:/tmp/gunicorn.sock --timeout 360 --max-requests 250 --preload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If this is executed, it means the previous command failed, don't display the congratulations message
|
# If this is executed, it means the previous command failed, don't display the congratulations message
|
||||||
|
|
Ładowanie…
Reference in New Issue