Преглед на файлове

视频号爬虫增加cursor判断

luojunhui преди 7 месеца
родител
ревизия
db0d0105e4
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      tasks/crawler_channel_account_videos.py

+ 5 - 1
tasks/crawler_channel_account_videos.py

@@ -53,7 +53,11 @@ class CrawlerChannelAccountVideos:
         """
         get channel account list from database
         """
-        sql = f"""select account_id, max_cursor from sph_account_for_videos where status = {const.CHANNEL_ACCOUNT_GOOD_STATUS};"""
+        sql = f"""
+            select account_id, max_cursor 
+            from sph_account_for_videos 
+            where status = {const.CHANNEL_ACCOUNT_GOOD_STATUS}
+            order by max_cursor;"""
         account_list = self.db_client.fetch(query=sql, cursor_type=DictCursor)
         return account_list