This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
import logging | |
from operator import methodcaller | |
import asyncio | |
from elasticsearch.exceptions import TransportError | |
from elasticsearch.helpers import BulkIndexError, expand_action, _chunk_actions | |
from elasticsearch.compat import map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apscheduler.schedulers.background import BackgroundScheduler | |
from apscheduler.executors.pool import ThreadPoolExecutor | |
from apscheduler.jobstores.memory import MemoryJobStore | |
from apscheduler.job import Job | |
import json | |
import logging | |
from apscheduler.triggers.cron import CronTrigger | |
import time | |
from celery import Celery | |
from typing import List |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def json_error(status_code: int, exception: Exception) -> web.Response: | |
""" | |
Returns a Response from an exception. | |
Used for error middleware. | |
:param status_code: | |
:param exception: | |
:return: | |
""" | |
return web.Response( | |
status=status_code, |