rewrite threading code in jobwatchd
now it distributes the tasks properly among all threads, and it can be used as a standalone program. there are some minor performance issues which will be fixed shortly.
This commit is contained in:
14
ppf.py
14
ppf.py
@@ -149,7 +149,6 @@ def proxyleech(sqlite, rows):
|
||||
|
||||
if __name__ == '__main__':
|
||||
config.load()
|
||||
print repr(config.torhosts)
|
||||
proxies={'http':'socks4://%s' % random.choice(config.torhosts),'https':'socks4://%s' % random.choice(config.torhosts)}
|
||||
|
||||
sqlite = mysqlite.mysqlite(config.database, str)
|
||||
@@ -172,7 +171,11 @@ if __name__ == '__main__':
|
||||
empty = [ urignore.append(i.split('/')[2]) for i in searx_instances ]
|
||||
|
||||
# start proxy watcher
|
||||
watcherd = proxywatchd.Proxywatchd() if config.watchd_threads > 0 else None
|
||||
if config.watchd_threads > 0:
|
||||
watcherd = proxywatchd.Proxywatchd()
|
||||
watcherd.run_background()
|
||||
else:
|
||||
watcherd = None
|
||||
|
||||
while True:
|
||||
try:
|
||||
@@ -184,9 +187,12 @@ if __name__ == '__main__':
|
||||
## sleep
|
||||
else: time.sleep(10)
|
||||
|
||||
except KeyboardInterrupt: break
|
||||
except KeyboardInterrupt:
|
||||
print "XXXXXX"
|
||||
if watcherd: watcherd.stop()
|
||||
break
|
||||
|
||||
print '\r',
|
||||
|
||||
# stop things
|
||||
if watcherd: watcherd.stop()
|
||||
#if watcherd: watcherd.stop()
|
||||
|
||||
Reference in New Issue
Block a user