Skip to content

Commit

Permalink
Merge pull request getredash#165 from erans/master
Browse files Browse the repository at this point in the history
Make sure qr serialization will always be in JSON
  • Loading branch information
arikfr committed Apr 7, 2014
2 parents 2d3348b + e50aa53 commit 7adf4bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion redash/data/manager.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@
import peewee
import qr
import redis
import json
from redash import models
from redash.data import worker
from redash.utils import gen_query_hash


class JSONPriorityQueue(qr.PriorityQueue):
""" Use a JSON serializer to help with cross language support """
def __init__(self, key, **kwargs):
super(qr.PriorityQueue, self).__init__(key, **kwargs)
self.serializer = json


class Manager(object):
def __init__(self, redis_connection, statsd_client):
self.statsd_client = statsd_client
self.redis_connection = redis_connection
self.workers = []
self.queue = qr.PriorityQueue("jobs", **self.redis_connection.connection_pool.connection_kwargs)
self.queue = JSONPriorityQueue("jobs", **self.redis_connection.connection_pool.connection_kwargs)
self.max_retries = 5
self.status = {
'last_refresh_at': 0,
Expand Down

0 comments on commit 7adf4bf

Please sign in to comment.