mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-21 18:30:06 +00:00
add stats as upsert in case of binlog not being sequential
This commit is contained in:
parent
00c768c722
commit
40c34e7df0
|
@ -58,7 +58,8 @@ stream = BinLogStreamReader(
|
||||||
'host': MYSQL_HOST,
|
'host': MYSQL_HOST,
|
||||||
'port': MYSQL_PORT,
|
'port': MYSQL_PORT,
|
||||||
'user': MYSQL_USER,
|
'user': MYSQL_USER,
|
||||||
'passwd': MYSQL_PW
|
'passwd': MYSQL_PW,
|
||||||
|
|
||||||
},
|
},
|
||||||
server_id=10, # arbitrary
|
server_id=10, # arbitrary
|
||||||
# only care about this database currently
|
# only care about this database currently
|
||||||
|
@ -124,7 +125,7 @@ def reindex_stats(s, index_name):
|
||||||
"download_count": s["download_count"],
|
"download_count": s["download_count"],
|
||||||
"leech_count": s['leech_count'],
|
"leech_count": s['leech_count'],
|
||||||
"seed_count": s['seed_count'],
|
"seed_count": s['seed_count'],
|
||||||
}})
|
}, "doc_as_upsert": True})
|
||||||
|
|
||||||
n = 0
|
n = 0
|
||||||
last_save = time.time()
|
last_save = time.time()
|
||||||
|
|
Loading…
Reference in a new issue