cpu: be gentle

sleep 0.1 sec when adding proxies and urls to database
This commit is contained in:
mickael
2019-01-05 01:17:12 +00:00
parent 8f6f9d2f2e
commit f8b1b53fe9

2
ppf.py
View File

@@ -64,6 +64,7 @@ def insert_proxies(proxies, uri, sqlite):
sqlite.executemany('INSERT INTO proxylist (added,proxy,failed,tested) VALUES (?,?,?,?)', new)
sqlite.commit()
_log('+%d item(s) from %s' % (len(new), uri), 'added')
time.sleep(0.1)
def proxyfind(sqlite = None):
#print('entering proxyfind...')
@@ -99,6 +100,7 @@ def proxyfind(sqlite = None):
sqlite.executemany('INSERT INTO uris (added,url,check_time,error,driver) values(?,?,?,?,?)', new)
sqlite.commit()
_log('+%d item(s) from %s' % (len(new), search), 'added')
time.sleep(0.1)
sqlite.commit()