mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 15:52:21 -05:00
lazy init migrate
This commit is contained in:
@@ -90,10 +90,10 @@ db = SQLAlchemy(
|
|||||||
"pool_pre_ping": True,
|
"pool_pre_ping": True,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
migrate = Migrate()
|
migrate = None
|
||||||
notify_celery = NotifyCelery()
|
notify_celery = NotifyCelery()
|
||||||
aws_ses_client = AwsSesClient()
|
aws_ses_client = AwsSesClient()
|
||||||
aws_ses_stub_client = AwsSesStubClient()
|
aws_ses_stub_client = None
|
||||||
aws_sns_client = AwsSnsClient()
|
aws_sns_client = AwsSnsClient()
|
||||||
aws_cloudwatch_client = AwsCloudwatchClient()
|
aws_cloudwatch_client = AwsCloudwatchClient()
|
||||||
encryption = Encryption()
|
encryption = Encryption()
|
||||||
@@ -155,20 +155,23 @@ def create_app(application):
|
|||||||
register_socket_handlers(socketio)
|
register_socket_handlers(socketio)
|
||||||
request_helper.init_app(application)
|
request_helper.init_app(application)
|
||||||
db.init_app(application)
|
db.init_app(application)
|
||||||
migrate.init_app(application, db=db)
|
|
||||||
logging.init_app(application)
|
logging.init_app(application)
|
||||||
aws_sns_client.init_app(application)
|
aws_sns_client.init_app(application)
|
||||||
|
|
||||||
aws_ses_client.init_app()
|
aws_ses_client.init_app()
|
||||||
aws_ses_stub_client.init_app(stub_url=application.config["SES_STUB_URL"])
|
|
||||||
aws_cloudwatch_client.init_app(application)
|
aws_cloudwatch_client.init_app(application)
|
||||||
|
|
||||||
# start lazy initialization for gevent
|
# start lazy initialization for gevent
|
||||||
|
migrate = Migrate()
|
||||||
|
migrate.init_app(application, db=db)
|
||||||
zendesk_client = ZendeskClient()
|
zendesk_client = ZendeskClient()
|
||||||
zendesk_client.init_app(application)
|
zendesk_client.init_app(application)
|
||||||
document_download_client = DocumentDownloadClient()
|
document_download_client = DocumentDownloadClient()
|
||||||
document_download_client.init_app(application)
|
document_download_client.init_app(application)
|
||||||
|
|
||||||
|
aws_ses_stub_client = AwsSesStubClient()
|
||||||
|
aws_ses_stub_client.init_app(stub_url=application.config["SES_STUB_URL"])
|
||||||
|
|
||||||
# end lazy initialization
|
# end lazy initialization
|
||||||
|
|
||||||
# If a stub url is provided for SES, then use the stub client rather than the real SES boto client
|
# If a stub url is provided for SES, then use the stub client rather than the real SES boto client
|
||||||
@@ -184,7 +187,6 @@ def create_app(application):
|
|||||||
notify_celery.init_app(application)
|
notify_celery.init_app(application)
|
||||||
encryption.init_app(application)
|
encryption.init_app(application)
|
||||||
redis_store.init_app(application)
|
redis_store.init_app(application)
|
||||||
document_download_client.init_app(application)
|
|
||||||
|
|
||||||
register_blueprint(application)
|
register_blueprint(application)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user