Skip to content

Commit

Permalink
fix: 签到使用线程池
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Nov 18, 2024
1 parent 5f30963 commit 0dc152e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/plugins/modules/autosignin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from concurrent.futures import ThreadPoolExecutor
import copy
import re
import json
from datetime import datetime, timedelta
from multiprocessing.dummy import Pool as ThreadPool
from threading import Event
from time import sleep
from urllib.parse import urlsplit

import pytz
from lxml import etree
Expand Down Expand Up @@ -342,7 +341,7 @@ def sign_in(self, event=None):
sign_sites = new_sign_sites
# 执行签到
self.info("开始执行签到任务")
with ThreadPool(min(len(sign_sites), int(self._queue_cnt) if self._queue_cnt else 10)) as p:
with ThreadPoolExecutor(min(len(sign_sites), int(self._queue_cnt) if self._queue_cnt else 10)) as p:
status = p.map(self.signin_site, sign_sites)

if status:
Expand Down

0 comments on commit 0dc152e

Please sign in to comment.