spiff-arena/spiffworkflow-backend/bin/start_blocking_appscheduler.py
Kevin Burnett 9313a9f73a Feature/event payloads part 2 (#401)
* Revert "Revert "Feature/event payloads (#393)""

This reverts commit 95fafb7af118cbe81ca20600bbb83e54e0936a5a.

* Revert "Revert "poet not available in container""

This reverts commit 140220498c284163dc02f8075fac949dff4de9e5.

* Revert "Revert "Run event payloads data migration from background processor (#399)""

This reverts commit 2afced3a51cda18491bc23b344bf2bada41393d5.

* Revert "Revert "using new spiff api to get info about events. w/ elizabeth""

This reverts commit af857fee229fc89824e45a5d36ab0178e284ed44.

* Revert "Revert "fix tests for waiting_event_can_be_skipped""

This reverts commit 886e6bd42a94390bf4d863ec79bff0a3831f6fcf.

* push image for preview env

* default scripts to localhost w/ burnettk

* use the bugfix/update-split-task-inputs spiffworkflow branch w/ burnettk

* removed debug json files

* use main for spiffworkflow

* do not attempt to highlight non-diagram boundary items w/ burnettk

* updated SpiffWorkflow to fix multiple signal event issue w/ burnettk

---------

Co-authored-by: burnettk <burnettk@users.noreply.github.com>
Co-authored-by: jasquat <jasquat@users.noreply.github.com>
2023-08-10 18:24:49 +05:30

35 lines
1.0 KiB
Python
Executable File

"""Start the appscheduler in blocking mode."""
import time
from apscheduler.schedulers.background import BlockingScheduler # type: ignore
from spiffworkflow_backend import create_app
from spiffworkflow_backend import start_scheduler
from spiffworkflow_backend.data_migrations.version_1_3 import VersionOneThree
from spiffworkflow_backend.helpers.db_helper import try_to_connect
def main() -> None:
seconds_to_wait = 300
print(f"sleeping for {seconds_to_wait} seconds to give the api container time to run the migration")
time.sleep(seconds_to_wait)
print("done sleeping")
print("running data migration from background processor")
app = create_app()
start_time = time.time()
with app.app_context():
try_to_connect(start_time)
VersionOneThree().run()
end_time = time.time()
print(
f"done running data migration from background processor. took {end_time - start_time} seconds. starting"
" scheduler"
)
start_scheduler(app, BlockingScheduler)
if __name__ == "__main__":
main()