auto-sync: 2026-05-05 09:02:54

This commit is contained in:
cfdaily
2026-05-05 09:02:54 +08:00
parent c686fa5704
commit a3b1934ddf
+16 -1
View File
@@ -673,7 +673,7 @@ def run_15min_update(codes: List[str]) -> dict:
break break
if i > 0: if i > 0:
time.sleep(REQUEST_INTERVAL) time.sleep(REQUEST_INTERVAL_SINA)
try: try:
status, new_rows, db_values = update_15min_parquet(code) status, new_rows, db_values = update_15min_parquet(code)
@@ -735,6 +735,21 @@ def _write_vnpy_db(values: list, label: str):
conn = sqlite3.connect(local_tmp, timeout=30) conn = sqlite3.connect(local_tmp, timeout=30)
c = conn.cursor() c = conn.cursor()
c.execute("PRAGMA journal_mode=WAL") c.execute("PRAGMA journal_mode=WAL")
c.execute("""CREATE TABLE IF NOT EXISTS dbbardata (
id INTEGER PRIMARY KEY AUTOINCREMENT,
symbol TEXT NOT NULL,
exchange TEXT NOT NULL,
datetime TEXT NOT NULL,
interval TEXT NOT NULL,
volume REAL DEFAULT 0,
turnover REAL DEFAULT 0,
open_interest REAL DEFAULT 0,
open_price REAL,
high_price REAL,
low_price REAL,
close_price REAL,
UNIQUE(symbol, exchange, datetime, interval)
)""")
c.executemany( c.executemany(
"""INSERT OR REPLACE INTO dbbardata """INSERT OR REPLACE INTO dbbardata
(symbol,exchange,datetime,interval,volume,turnover,open_interest, (symbol,exchange,datetime,interval,volume,turnover,open_interest,