Commit 71269566 authored by lixiaofang's avatar lixiaofang

redis

parent 0edf6d23
import requests import requests
import traceback import traceback
import logging import logging
import json
from libs.cache import redis_client
login_url = "http://earth.iyanzhi.com/api/account/login_pwd" login_url = "http://earth.iyanzhi.com/api/account/login_pwd"
...@@ -55,13 +57,11 @@ def get_cook(): ...@@ -55,13 +57,11 @@ def get_cook():
def get_session(): def get_session():
try: try:
session_key = "majia_login_session"
dicts = get_cook() dicts = get_cook()
with open("/srv/apps/physical/vest/data/user_session.txt", 'w') as f: for key, value in dicts.items():
for key, value in dicts.items(): redis_client.hset(session_key, key, value)
f.write(key)
f.write(",")
f.write(value)
f.write("\n")
except: except:
logging.error("index_first:%s" % traceback.format_exc()) logging.error("index_first:%s" % traceback.format_exc())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment