Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
alter ltclient so that it waits a random amount of time (0 - 30s) bef…
Browse files Browse the repository at this point in the history
…ore checking on completion. This helps prevent all the nodes from SSHing in at the same time
  • Loading branch information
BuzzTroll committed Sep 10, 2010
1 parent 8f290e9 commit 5ee94fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion control/bin/ltclient.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ fi
# check for an error every 30 seconds.. this may need to be in a decent language
cnt=0
done="False"
thresh=`expr $RANDOM % 30`
while [ ! -e $localpath ];
do
sleep 1
cnt=`expr $cnt + 1`

# if we have waited 30 seconds verify that there wasnt an error
if [ $cnt -gt 30 ]; then
if [ $cnt -gt $thresh ]; then
echo "ltclient checking in..."
thresh=30
cnt=0
out=`ssh -p $port $userhost "$remoteexe" --nonblock --reattach "$rid"`
if [ $? -ne 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion lantorrent/pylantorrent/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def getrows(con):

def do_it_live(con, rows):

pylantorrent.log(logging.INFO, "lan torrent daemon setting up to send")
pylantorrent.log(logging.INFO, "lan torrent daemon setting up to send %d in a group" % (len(rows))

c = con.cursor()
dests = []
Expand Down

0 comments on commit 5ee94fe

Please sign in to comment.