mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
merge from main
This commit is contained in:
@@ -2,10 +2,12 @@ import json
|
||||
from datetime import datetime, timedelta
|
||||
from os import getenv, path
|
||||
|
||||
from boto3 import Session
|
||||
from celery.schedules import crontab
|
||||
from kombu import Exchange, Queue
|
||||
|
||||
import notifications_utils
|
||||
from app.clients import AWS_CLIENT_CONFIG
|
||||
from app.cloudfoundry_config import cloud_config
|
||||
|
||||
|
||||
@@ -51,6 +53,13 @@ class TaskNames(object):
|
||||
SCAN_FILE = "scan-file"
|
||||
|
||||
|
||||
session = Session(
|
||||
aws_access_key_id=getenv("CSV_AWS_ACCESS_KEY_ID"),
|
||||
aws_secret_access_key=getenv("CSV_AWS_SECRET_ACCESS_KEY"),
|
||||
region_name=getenv("CSV_AWS_REGION"),
|
||||
)
|
||||
|
||||
|
||||
class Config(object):
|
||||
NOTIFY_APP_NAME = "api"
|
||||
DEFAULT_REDIS_EXPIRE_TIME = 4 * 24 * 60 * 60
|
||||
@@ -166,6 +175,9 @@ class Config(object):
|
||||
|
||||
current_minute = (datetime.now().minute + 1) % 60
|
||||
|
||||
S3_CLIENT = session.client("s3")
|
||||
S3_RESOURCE = session.resource("s3", config=AWS_CLIENT_CONFIG)
|
||||
|
||||
CELERY = {
|
||||
"worker_max_tasks_per_child": 500,
|
||||
"task_ignore_result": True,
|
||||
|
||||
Reference in New Issue
Block a user