update
This commit is contained in:
Binary file not shown.
@ -8,7 +8,7 @@ app = FastAPI()
|
|||||||
|
|
||||||
|
|
||||||
async def add_stream(data: dict):
|
async def add_stream(data: dict):
|
||||||
redis = await aioredis.Redis(host="127.0.0.1", port=6379)
|
redis = await aioredis.Redis(host="127.0.0.1", port=7019, password="SMHdFrlK")
|
||||||
await redis.lpush("hik-sub-event", json.dumps(data))
|
await redis.lpush("hik-sub-event", json.dumps(data))
|
||||||
await redis.close()
|
await redis.close()
|
||||||
|
|
||||||
|
BIN
hik_push/mapping/__pycache__/event_map.cpython-312.pyc
Normal file
BIN
hik_push/mapping/__pycache__/event_map.cpython-312.pyc
Normal file
Binary file not shown.
@ -22,7 +22,7 @@ async def read_event():
|
|||||||
print(config)
|
print(config)
|
||||||
user_map = config['user_ids']
|
user_map = config['user_ids']
|
||||||
device_map = config['devices']
|
device_map = config['devices']
|
||||||
redis_client = await aioredis.Redis(host="127.0.0.1", port=6379)
|
redis_client = await aioredis.Redis(host="127.0.0.1", port=7019, password="SMHdFrlK")
|
||||||
while True:
|
while True:
|
||||||
data = await redis_client.brpop("hik-sub-event")
|
data = await redis_client.brpop("hik-sub-event")
|
||||||
sub_json = json.loads(data[1].decode('utf-8'))
|
sub_json = json.loads(data[1].decode('utf-8'))
|
||||||
|
Reference in New Issue
Block a user