예제 #1
0

        
예제 #2
0
server_port = cfg.getint("Server", "port")

app = Flask(__name__)

redis_server_log = redis.StrictRedis(host=cfg.get('RedisGlobal', 'host'),
                                     port=cfg.getint('RedisGlobal', 'port'),
                                     db=cfg.getint('RedisLog', 'db'))
redis_server_map = redis.StrictRedis(host=cfg.get('RedisGlobal', 'host'),
                                     port=cfg.getint('RedisGlobal', 'port'),
                                     db=cfg.getint('RedisMap', 'db'))
serv_redis_db = redis.StrictRedis(host=cfg.get('RedisGlobal', 'host'),
                                  port=cfg.getint('RedisGlobal', 'port'),
                                  db=cfg.getint('RedisDB', 'db'))

geo_helper = geo_helper.Geo_helper(serv_redis_db, cfg)
contributor_helper = contributor_helper.Contributor_helper(serv_redis_db, cfg)
users_helper = users_helper.Users_helper(serv_redis_db, cfg)
trendings_helper = trendings_helper.Trendings_helper(serv_redis_db, cfg)

subscriber_log = redis_server_log.pubsub(ignore_subscribe_messages=True)
subscriber_log.psubscribe(cfg.get('RedisLog', 'channel'))
subscriber_map = redis_server_map.pubsub(ignore_subscribe_messages=True)
subscriber_map.psubscribe(cfg.get('RedisMap', 'channelDisp'))
subscriber_lastContrib = redis_server_log.pubsub(
    ignore_subscribe_messages=True)
subscriber_lastContrib.psubscribe(cfg.get('RedisLog',
                                          'channelLastContributor'))
subscriber_lastAwards = redis_server_log.pubsub(ignore_subscribe_messages=True)
subscriber_lastAwards.psubscribe(cfg.get('RedisLog', 'channelLastAwards'))

eventNumber = 0