run a job executor in the daemon for testing
Gitea/photolib/pipeline/head There was a failure building this commit Details

This commit is contained in:
dave 2023-01-31 09:24:23 -08:00
parent 1e0c323b67
commit b582101543
1 changed files with 8 additions and 1 deletions

View File

@ -18,7 +18,7 @@ from photoapp.dbutils import SAEnginePlugin, SATool, db, get_db_engine, date_for
from photoapp.utils import auth, require_auth, photoset_auth_filter, slugify, cherryparam, number_format
from photoapp.storage import uri_to_storage
from photoapp.webutils import validate_password, serve_thumbnail_placeholder
from photoapp.jobs import JobsClient, JobSubscriber
from photoapp.jobs import JobsClient, JobSubscriber, ThreadJobServer
from jinja2 import Environment, FileSystemLoader, select_autoescape
from sqlalchemy import desc, asc, func, and_, or_
@ -719,6 +719,13 @@ def main():
library_manager = LibraryManager(library_storage)
cache_manager = uri_to_storage(args.cache)
# set up jobs system - this is temporary, this will be something pluggable later
jobs_db_engine = get_db_engine(args.database, debug=args.db_debug)
jobs_server = ThreadJobServer(jobs_db_engine)
jobs_server.run_background()
jobs_client = JobsClient(jobs_db_engine, notifier=jobs_server.queue_notify)
JobSubscriber(jobs_client)
# set up webapp
setup_webapp(
get_db_engine(args.database, debug=args.db_debug),