into_workflow_progress=f"update workflow_progress set status_val=3,status='抓取结束' where page='店铺产品' and date_info='{self.year_month.replace('_', '-')}' and site_name='{self.site_name}' and date_type='month'"
print(into_workflow_progress)
cursor_us.execute(into_workflow_progress)
...
...
@@ -436,7 +436,7 @@ class async_account_name_products(BaseUtils):
}
try:
requests.post(url=url,data=data,timeout=15)
except:
exceptException:
pass
cursor_us.close()
connect_us.close()
...
...
@@ -475,21 +475,21 @@ class async_account_name_products(BaseUtils):
self.engine=self.mysql_connect()
sql_read=f'SELECT account_name, id, seller_id FROM {self.db_seller_account_syn} WHERE product_state=1 LIMIT {self.read_size} for update;'
print(sql_read)
self.df_read=self.engine.read_sql(sql_read)
ifself.df_read.shape[0]==0:
self.stop_item_queue=False
return[]
withself.engine.begin()asconn:
self.index_tuple=tuple(self.df_read['id'])
iflen(self.index_tuple)==1:
sql_update=f"""UPDATE {self.db_seller_account_syn} a set product_state=2 where a.id in ({self.index_tuple[0]})"""
else:
sql_update=f"""UPDATE {self.db_seller_account_syn} a set product_state=2 where a.id in {self.index_tuple}"""