introduce an ApplicationConfig module to manage the environment configs in one location
This commit is contained in:
@ -2,6 +2,7 @@ import os, json, random, io, logging
|
||||
|
||||
from pulp import LpProblem, LpVariable, LpMinimize, LpMaximize, LpAffineExpression, LpConstraint, LpStatus, lpSum
|
||||
|
||||
from lib.application_configs import ApplicationConfigs
|
||||
from helpers import aws_helper, tar_helper, csv_helper, service_helper, solver_helper
|
||||
from lib.errors.item_generation_error import ItemGenerationError
|
||||
|
||||
@ -201,14 +202,14 @@ class LoftService(Base):
|
||||
|
||||
if error:
|
||||
logging.info('Streaming %s error response to s3 bucket - %s',
|
||||
self.file_name, os.environ['S3_PROCESSED_BUCKET'])
|
||||
self.file_name, ApplicationConfigs.s3_processed_bucket)
|
||||
solution_file = service_helper.error_to_file(buffer, error)
|
||||
else:
|
||||
logging.info('Streaming %s to s3 bucket - %s', self.file_name,
|
||||
os.environ['S3_PROCESSED_BUCKET'])
|
||||
ApplicationConfigs.s3_processed_bucket)
|
||||
solution_file = service_helper.solution_to_file(
|
||||
buffer, self.solver_run.total_form_items, self.solution.forms)
|
||||
|
||||
# upload generated file to s3 and return result
|
||||
return aws_helper.file_stream_upload(solution_file, self.file_name,
|
||||
os.environ['S3_PROCESSED_BUCKET'])
|
||||
ApplicationConfigs.s3_processed_bucket)
|
||||
|
Reference in New Issue
Block a user