cpu: be gentle
sleep 0.1 sec when adding proxies and urls to database
This commit is contained in:
2
ppf.py
2
ppf.py
@@ -64,6 +64,7 @@ def insert_proxies(proxies, uri, sqlite):
|
|||||||
sqlite.executemany('INSERT INTO proxylist (added,proxy,failed,tested) VALUES (?,?,?,?)', new)
|
sqlite.executemany('INSERT INTO proxylist (added,proxy,failed,tested) VALUES (?,?,?,?)', new)
|
||||||
sqlite.commit()
|
sqlite.commit()
|
||||||
_log('+%d item(s) from %s' % (len(new), uri), 'added')
|
_log('+%d item(s) from %s' % (len(new), uri), 'added')
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
def proxyfind(sqlite = None):
|
def proxyfind(sqlite = None):
|
||||||
#print('entering proxyfind...')
|
#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.executemany('INSERT INTO uris (added,url,check_time,error,driver) values(?,?,?,?,?)', new)
|
||||||
sqlite.commit()
|
sqlite.commit()
|
||||||
_log('+%d item(s) from %s' % (len(new), search), 'added')
|
_log('+%d item(s) from %s' % (len(new), search), 'added')
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
sqlite.commit()
|
sqlite.commit()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user