Update API code to function in all (local/dev/production) environments
parent
b526c072a1
commit
0675146f38
|
@ -31,6 +31,8 @@ application.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://{}:{}@{}:{}/{}'.fo
|
|||
os.environ['DB_PORT'],
|
||||
os.environ['DB_NAME']
|
||||
)
|
||||
application.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
||||
|
||||
application.config['ELASTICSEARCH_INDEX_URI'] = '{}:{}'.format(
|
||||
os.environ['ES_HOST'],
|
||||
os.environ['ES_PORT']
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from flask_sqlalchemy import SQLAlchemy
|
||||
|
||||
from model.cce import CCE
|
||||
from model.errorCCE import ErrorCCE
|
||||
from model.registration import Registration
|
||||
from model.renewal import Renewal, RENEWAL_REG
|
||||
from model.volume import Volume
|
||||
|
|
13
main.py
13
main.py
|
@ -3,11 +3,6 @@ from datetime import datetime, timedelta
|
|||
import os
|
||||
import yaml
|
||||
|
||||
from sessionManager import SessionManager
|
||||
from builder import CCEReader, CCEFile
|
||||
from renBuilder import CCRReader, CCRFile
|
||||
from esIndexer import ESIndexer
|
||||
|
||||
|
||||
def main(secondsAgo=None, year=None, exclude=None, reinit=False):
|
||||
manager = SessionManager()
|
||||
|
@ -25,7 +20,7 @@ def main(secondsAgo=None, year=None, exclude=None, reinit=False):
|
|||
if exclude != 'ccr':
|
||||
loadCCR(manager, loadFromTime, year)
|
||||
|
||||
indexUpdates(manager, None)
|
||||
indexUpdates(manager, loadFromTime)
|
||||
|
||||
manager.closeConnection()
|
||||
|
||||
|
@ -81,6 +76,12 @@ if __name__ == '__main__':
|
|||
loadConfig()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
from sessionManager import SessionManager
|
||||
from builder import CCEReader, CCEFile
|
||||
from renBuilder import CCRReader, CCRFile
|
||||
from esIndexer import ESIndexer
|
||||
|
||||
main(
|
||||
secondsAgo=args.time,
|
||||
year=args.year,
|
||||
|
|
Loading…
Reference in New Issue