refactor valkey into objects with health check

This commit is contained in:
2026-05-15 11:34:25 +09:00
parent f5f43be1a1
commit 1fd922d98f
25 changed files with 6461 additions and 9613 deletions

View File

@@ -2,9 +2,18 @@ import logging
from dotenv import load_dotenv
import requests
import os
import json
from decimal import Decimal
load_dotenv()
class JSONEncoder_Decimal(json.JSONEncoder):
def default(self, o):
if isinstance(o, Decimal):
return float(o)
return super(JSONEncoder_Decimal, self).default(o)
def upsert_list_of_dicts_by_id(list_of_dicts, new_dict, id='id', seq_check_field: str | None = None, reset_seq_id: bool = False) -> list[dict]:
for index, item in enumerate(list_of_dicts):
if item.get(id) == new_dict.get(id):