Example #1
0
CLOUDAMQP_URL = os.environ.get('CLOUDAMQP_URL')
REDIS_URL = os.environ.get('OPENREDIS_URL')
IA_ACCESS_KEY_ID = os.environ.get('IA_ACCESS_KEY_ID')
IA_SECRET_ACCESS_KEY = os.environ.get('IA_SECRET_ACCESS_KEY')
IA_BUCKET = os.environ.get('IA_BUCKET')
SEARCH_TIMEOUT = 50

# Connection pools.
celery = Celery(broker=CLOUDAMQP_URL)
es = ElasticSearch(ELASTICSEARCH_URL)
bucket = S3Connection().get_bucket(S3_BUCKET)
ia = boto.connect_ia(IA_ACCESS_KEY_ID, IA_SECRET_ACCESS_KEY)
archive = ia.lookup(IA_BUCKET)

cache = Cache()
cache.cache = RedisCache()
cache.cache._client = redis.from_url(REDIS_URL)


class Record(object):
    def __init__(self):
        self.uuid = str(uuid4())
        self.content_type = 'application/octet-stream'
        self.epoch = epoch()
        self.added = epoch()
        self.filename = None
        self.ref = None
        self.description = None
        self.author = None
        self.links = {}
        self.metadata = {}
Example #2
0
CLOUDAMQP_URL = os.environ.get('CLOUDAMQP_URL')
REDIS_URL = os.environ.get('OPENREDIS_URL')
IA_ACCESS_KEY_ID = os.environ.get('IA_ACCESS_KEY_ID')
IA_SECRET_ACCESS_KEY = os.environ.get('IA_SECRET_ACCESS_KEY')
IA_BUCKET = os.environ.get('IA_BUCKET')
SEARCH_TIMEOUT = 50

# Connection pools.
celery = Celery(broker=CLOUDAMQP_URL)
es = ElasticSearch(ELASTICSEARCH_URL)
bucket = S3Connection().get_bucket(S3_BUCKET)
ia = boto.connect_ia(IA_ACCESS_KEY_ID, IA_SECRET_ACCESS_KEY)
archive = ia.lookup(IA_BUCKET)

cache = Cache()
cache.cache = RedisCache()
cache.cache._client = redis.from_url(REDIS_URL)

class Record(object):
    def __init__(self):
        self.uuid = str(uuid4())
        self.content_type = 'application/octet-stream'
        self.epoch = epoch()
        self.added = epoch()
        self.filename = None
        self.ref = None
        self.description = None
        self.author = None
        self.links = {}
        self.metadata = {}