show die-status in the stats list

This commit is contained in:
2019-07-08 11:39:38 +03:00
parent 62a22639b1
commit da5c54017c
2 changed files with 7 additions and 4 deletions

View File

@@ -209,7 +209,7 @@ class DataBase:
def list(self): def list(self):
self.db = self.conn.cursor() self.db = self.conn.cursor()
self.db.execute("SELECT id,port,host,date,pid FROM ports ORDER BY id") self.db.execute("SELECT id,port,host,date,pid,die FROM ports ORDER BY id")
rows = [] rows = []
for row in self.db: for row in self.db:
row = list(row) row = list(row)
@@ -271,7 +271,7 @@ if __name__ == "__main__":
if opts.list: if opts.list:
print(tabulate( print(tabulate(
db.list(), db.list(),
headers = ['Id','Port','Host','Age','PID','Alive'] headers = ['Id','Port','Host','Age','PID','Die','Alive']
)) ))
if opts.query != None: if opts.query != None:
@@ -297,7 +297,7 @@ if __name__ == "__main__":
db.check_die() db.check_die()
db.update(opts.id) db.update(opts.id)
for i in range(10): for i in range(10):
time.sleep(1)#0 * random.random()) time.sleep(10 * random.random())
ewrite( ewrite(
" " + " " +
time.strftime("%c") + time.strftime("%c") +

View File

@@ -42,6 +42,9 @@ while true; do
# failed # failed
#_ssh bin/ssh-kill $USER@$HOSTNAME $port || true #_ssh bin/ssh-kill $USER@$HOSTNAME $port || true
} }
sleep 10 for i in {1..10}; do
sleep 1
printf " $i\r"
done
done done
kill %1 kill %1