Commit Graph

66 Commits

Author SHA1 Message Date
mickael
1a025f102f only load search/bad terms when "search" arg is enabled 2019-01-06 18:31:42 +00:00
mickael
5e9f8baf56 remove unused imports 2019-01-06 18:27:06 +00:00
mickael
e4636df468 delay thread startup 2019-01-06 17:52:56 +00:00
mserneels
03a1c47ff2 Merge branch 'changes5' into 'master'
Changes5

See merge request mserneels/ppf!5
2019-01-06 16:38:44 +00:00
rofl0r
7d8583f7cc no need to re-raise keyboardinterrupt 2019-01-06 16:30:32 +00:00
rofl0r
14e4b832f2 proxywatchd: dont delete timestamp when printing halt msg 2019-01-06 16:29:17 +00:00
rofl0r
6c515d9335 don't continue testing offline proxies 2019-01-06 16:20:29 +00:00
mickael
41ce83a963 rocksock.py: bump to latest 2019-01-06 16:06:17 +00:00
mserneels
114c77dcf8 Merge branch 'changes4' into 'master'
save total_duration as int into the db

See merge request mserneels/ppf!4
2019-01-06 15:40:01 +00:00
rofl0r
a0dcd9fa8f save total_duration as int into the db
without that, the DB saves it as float even though the column type is
INT.

requires a run of

sqlite3 proxylist.sqlite "update proxylist set success_count=0,total_duration=0"

to fix existing entries.
2019-01-06 15:23:23 +00:00
mickael
1adf78119d take care of "failinc" 2019-01-06 14:57:09 +00:00
mickael
cff3e1304c remove rocksockexception block 2019-01-06 14:55:31 +00:00
mickael
0a34833d3d "prettier" thread exit message 2019-01-06 05:13:23 +00:00
mickael
6b4ca67b33 use e.get_failedproxy() 2019-01-06 05:02:02 +00:00
mickael
1f33a632fb update rocksock.py to latest 2019-01-06 04:53:20 +00:00
mickael
c661047381 connect_socket: single srv for all protos 2019-01-06 04:42:17 +00:00
mickael
e872caaa77 catch some rocksock errors
this allows ppf to skip checks when a theorical proxy fails in certain manners
2019-01-06 04:12:57 +00:00
mickael
64d9da9156 sleep even when no proxies are added 2019-01-06 02:58:58 +00:00
mickael
63b77043ac minor changes
remove comments, minimal code reorganization
2019-01-06 01:35:18 +00:00
mickael
aab7ef15d1 remove unnecessary global variable 2019-01-06 01:29:35 +00:00
mickael
ecc6bbce10 spaces2tab 2019-01-06 01:18:08 +00:00
mickael
922b630881 print number of defined threads 2019-01-06 00:51:20 +00:00
mickael
84a1de26c3 sqlite: do not create tables with "duration" column 2019-01-06 00:50:35 +00:00
mickael
4d513898fb make "submit_after" a configuratble option (config.ini) 2019-01-06 00:38:22 +00:00
mickael
1cafce67f0 no need to store 'duration' value in db 2019-01-05 23:55:40 +00:00
mickael
67cf6a18ea get rid of self.duration 2019-01-05 23:40:46 +00:00
mickael
dd4473279a fix: store total_duration in ms 2019-01-05 23:39:36 +00:00
mickael
0cb3525fe9 store total_duration in ms 2019-01-05 23:23:21 +00:00
mickael
aab72ad68b Merge branch 'master' of https://gitlab.com/mserneels/ppf 2019-01-05 22:57:57 +00:00
mserneels
5d64d07d00 Merge branch 'changes3' into 'master'
proxywatchd: improve logging

See merge request mserneels/ppf!3
2019-01-05 22:55:04 +00:00
mickael
d93f4dcaf2 introduce success_count and total_duration (proxylist.sqlit
run those commands to update the database:

sqlite3 proxylist.sqlite "alter table proxylist add success_count int"
sqlite3 proxylist.sqlite "alter table proxylist add total_duration int"
sqlite3 proxylist.sqlite "update proxylist set success_count=0,total_duration=0"
2019-01-05 22:24:38 +00:00
rofl0r
2bb75b6c42 proxywatchd: improve logging 2019-01-05 22:19:49 +00:00
mickael
3348435e21 remove unused variables 2019-01-05 21:56:45 +00:00
mserneels
b071400933 Merge branch 'changes2' into 'master'
Changes2

See merge request mserneels/ppf!2
2019-01-05 18:38:39 +00:00
rofl0r
dacbc8177a proxywatchd: fix memleak 2019-01-05 18:31:36 +00:00
rofl0r
74d9d965bb proxywatchd: always use a new mysql obj
could prevent memleaks, also helps thread-ownership issues.
2019-01-05 18:14:52 +00:00
mickael
cb342c3818 sqlite: use executemany
avoid loop inserting the whole list in a single query
2019-01-05 17:42:57 +00:00
mserneels
f79a537279 Merge branch 'changes' into 'master'
Changes

See merge request mserneels/ppf!1
2019-01-05 17:35:01 +00:00
rofl0r
af8f82924f fix logic so threads do an orderly shutdown
basically the issue was that the main loop received the SIGINT
and therefore broke out before reaching the parts of the code
that care about bringing down the child threads.

therefore there's now a finish() method that needs to be called
after stop().

because sqlite dbs insists to be used from the thread that created
the object, the DB cleanup operation are done from the thread
that controls it.

for standalone operation, in order to keep the main thread alive,
an additional run() method is used. this is not necessary when
used via ppf.py.
2019-01-05 17:17:27 +00:00
rofl0r
bb3da7122e ppf: properly reraise keyboard interrupts 2019-01-05 17:11:08 +00:00
rofl0r
47221bae94 properly clean submitted job list after db write 2019-01-05 16:44:31 +00:00
rofl0r
42f35855ea use a variable for the min number of jobs to collect
this variable determines after how many results the db is written to.
with a low value, it is written often and could more lock issues
if 2 threads concur for the db.
2019-01-05 16:39:58 +00:00
rofl0r
f45cd1190c fix performance issue in proxywatchd 2019-01-05 06:58:46 +00:00
rofl0r
9ac3ed45d6 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.
2019-01-05 06:35:41 +00:00
rofl0r
ff5d121d5f allow some config options optionally to be set by command line 2019-01-05 04:41:31 +00:00
rofl0r
ffbe450aee outsource configuration to external module 2019-01-05 03:47:03 +00:00
rofl0r
05294186d4 config sample: remove all unused items 2019-01-05 03:41:42 +00:00
mickael
09ea30b4e4 undo last change 2019-01-05 02:39:40 +00:00
mickael
f8b1b53fe9 cpu: be gentle
sleep 0.1 sec when adding proxies and urls to database
2019-01-05 01:17:12 +00:00
mickael
8f6f9d2f2e fix nonsense 2019-01-05 01:12:27 +00:00