cron 수정
This commit is contained in:
+4
-2
@@ -5,9 +5,11 @@ import time
|
|||||||
import glob
|
import glob
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
def run(webPath):
|
def run(webPath):
|
||||||
print(webPath)
|
now = datetime.now()
|
||||||
|
print(now.strftime("%Y-%m-%d %H:%M:%S"), webPath)
|
||||||
obj = urllib.request.urlopen(webPath)
|
obj = urllib.request.urlopen(webPath)
|
||||||
obj.read()
|
obj.read()
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ def main():
|
|||||||
|
|
||||||
servList.append(webPath)
|
servList.append(webPath)
|
||||||
|
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=len(servList)) as executor:
|
with concurrent.futures.ThreadPoolExecutor(max_workers=max(1,len(servList))) as executor:
|
||||||
waiters=[]
|
waiters=[]
|
||||||
for resetPath in autoResetList:
|
for resetPath in autoResetList:
|
||||||
future = executor.submit(run, resetPath)
|
future = executor.submit(run, resetPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user