modify scripts
This commit is contained in:
@ -48,12 +48,12 @@ def check_dirty_chapters():
|
||||
for i in range(100):
|
||||
table_name = f'{tbl_name_chapters_prefix}_{i}'
|
||||
try:
|
||||
cursor.execute(f"SELECT count(*) FROM {table_name} WHERE created_at >= '2025-03-23 10:20:00' and created_at <= '2025-03-23 11:20:00' ")
|
||||
cursor.execute(f"SELECT count(*) FROM {table_name} WHERE updated_at >= '2025-03-23 10:20:00' and updated_at <= '2025-03-23 11:20:00' ")
|
||||
row = cursor.fetchone()
|
||||
if row:
|
||||
dirty_chapters_all += row[0]
|
||||
|
||||
cursor.execute(f"SELECT count(*) FROM {table_name} WHERE created_at >= '2025-03-23 10:20:00' and created_at <= '2025-03-23 11:20:00' and content like '%aabook%' ")
|
||||
cursor.execute(f"SELECT count(*) FROM {table_name} WHERE updated_at >= '2025-03-23 10:20:00' and updated_at <= '2025-03-23 11:20:00' and content like '%aabook%' ")
|
||||
row = cursor.fetchone()
|
||||
if row:
|
||||
dirty_chapters += row[0]
|
||||
@ -70,7 +70,7 @@ def update_dirty_chapters():
|
||||
for i in range(100):
|
||||
table_name = f'{tbl_name_chapters_prefix}_{i}'
|
||||
try:
|
||||
cursor.execute(f"update {table_name} set has_content = 0 WHERE created_at >= '2025-03-23 10:20:00' and created_at <= '2025-03-23 11:20:00' ")
|
||||
cursor.execute(f"update {table_name} set has_content = 0 WHERE updated_at >= '2025-03-23 10:20:00' and updated_at <= '2025-03-23 11:20:00' ")
|
||||
updated_rows = cursor.rowcount
|
||||
print(f"update {table_name}, affected rows: {updated_rows}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user