Skip to content
Browse files

have daemon only pull those with less than 3 attempts

change ltclient (for now) to block forever until it sees the file
  • Loading branch information...
1 parent 059b0a2 commit c2e4bac19f9f19554752202476c396a70ab6a4a7 BuzzTroll committed
Showing with 6 additions and 6 deletions.
  1. +4 −4 control/bin/ltclient.sh
  2. +2 −2 lantorrent/pylantorrent/daemon.py
View
8 control/bin/ltclient.sh
@@ -24,10 +24,10 @@ do
# if we have waited 30 seconds verify that there wasnt an error
if [ $cnt -gt 30 ]; then
cnt=0
- ssh -p $port $userhost "$remoteexe" --nonblock --reattach "$rid"
- if [ $? -ne 0 ]; then
- exit $rc
- fi
+# ssh -p $port $userhost "$remoteexe" --nonblock --reattach "$rid"
+# if [ $? -ne 0 ]; then
+# exit $rc
+# fi
fi
done
View
4 lantorrent/pylantorrent/daemon.py
@@ -15,7 +15,7 @@
def getrows(con):
c = con.cursor()
tm = datetime.datetime.now() - datetime.timedelta(0, 5)
- s = "select distinct src_filename from requests where state = 0 and entry_time < ? limit 1"
+ s = "select distinct src_filename from requests where state = 0 and attempt_count < 3 and entry_time < ? limit 1"
data = (tm, )
c.execute(s, data)
r = c.fetchone()
@@ -27,7 +27,7 @@ def getrows(con):
# select
con.commit()
- s = "select hostname,port,src_filename,dst_filename,rid from requests where src_filename = ? and state = 0 order by hostname,port"
+ s = "select hostname,port,src_filename,dst_filename,rid from requests where src_filename = ? and state = 0 and attempt_count < 3 order by hostname,port"
data = (src_file, )
c.execute(s, data)
rows = c.fetchall()

0 comments on commit c2e4bac

Please sign in to comment.
Something went wrong with that request. Please try again.