2022-10-25 20:55:11 +00:00
|
|
|
"""Start the appscheduler in blocking mode."""
|
2024-03-27 18:05:49 +00:00
|
|
|
|
2022-10-25 20:55:11 +00:00
|
|
|
import time
|
|
|
|
|
|
|
|
from apscheduler.schedulers.background import BlockingScheduler # type: ignore
|
|
|
|
from spiffworkflow_backend import create_app
|
2023-12-05 16:41:59 +00:00
|
|
|
from spiffworkflow_backend.background_processing.apscheduler import start_apscheduler
|
2022-10-25 20:55:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
def main() -> None:
|
2024-06-13 17:34:32 +00:00
|
|
|
# TODO: in 30 days remove this sleep when the new bash wrapper script is on prod envs
|
|
|
|
seconds_to_wait = 100
|
2023-08-10 12:54:49 +00:00
|
|
|
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")
|
2024-06-13 17:34:32 +00:00
|
|
|
####
|
2023-08-10 12:54:49 +00:00
|
|
|
|
2022-10-25 20:55:11 +00:00
|
|
|
app = create_app()
|
2023-12-05 16:41:59 +00:00
|
|
|
start_apscheduler(app, BlockingScheduler)
|
2022-10-25 20:55:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|