# HG changeset patch # User HIROSE Yuuji # Date 1592092068 -32400 # Node ID 8448724f69e3da9c64ec4c3ac347412312e8bab8 # Parent 5d73f47cb1a9752429d28c0d3750a8d8404f1612 Account sync-ing and migration fixed diff -r 5d73f47cb1a9 -r 8448724f69e3 s4-migrate.sh --- a/s4-migrate.sh Sat Jun 13 20:26:36 2020 +0900 +++ b/s4-migrate.sh Sun Jun 14 08:47:48 2020 +0900 @@ -29,7 +29,7 @@ grp=`query "SELECT gname FROM main.grp WHERE rowid=$grid;"` htmlgrp=`echo "$grp"|htmlescape` qgrp=`sqlquote "$grp"` - if [ -n "`query 'SELECT gname FROM dst.grp WHERE gname=$qgrp;'`" ]; then + if [ -n "`query \"SELECT gname FROM dst.grp WHERE gname=$qgrp;\"`" ]; then echo "[$htmlgrp]グループがWorld[$htmlworld]にあるので中止します。"|html p failure=$((failure+1)) continue diff -r 5d73f47cb1a9 -r 8448724f69e3 s4-world.sh --- a/s4-world.sh Sat Jun 13 20:26:36 2020 +0900 +++ b/s4-world.sh Sun Jun 14 08:47:48 2020 +0900 @@ -9,13 +9,14 @@ worldnamefile=cache/worldname if [ ! -e $worldlistfile -o $worldlistfile -ot s4-config.sh \ -o ! -e $worldoptionfile -o $worldoptionfile -ot s4-config.sh \ - -o s4-funcs.sh -nt $worldoptionfile ] + -o s4-world.sh -nt $worldoptionfile ] then echo S4MASTERURL=$S4MASTERURL >> tmp/debug.out cat <<-EOF > $worldlistfile - ${touchpanel:+ : }
+ ${touchpanel:+ : ▼}
- + EOF true > $worldoptionfile for i in $S4WORLDLIST; do @@ -62,10 +63,19 @@ # sessdb=`dirname $S4MASTERDB`/sess.sq3 ## skey="skey-`basename $mydir`" syncflag=${db%.*}.synctime +runflag=${db%.*}.run userupdateflag=`dirname $S4MASTERDB`/`basename $userupdateflag` err SYNCFLAG=$syncflag test ! -e "$userupdateflag" && return test "$syncflag" -nt "$userupdateflag" && return +if [ -s "$runflag" ]; then + limit=`cat $runflag|tr -c -d 0-9` + if [ -n "$limit" -a "$limit" -gt `date +%s` ]; then + err "World $S4WORLD account sync withholded by process $$" + return # Running sync by other process not leaching timeout + fi +fi +echo $((`date +%s` + 10)) > $runflag # Setting running flag by timeout 10s # for sub.sq3 # @@ -76,9 +86,9 @@ # ## sqlite3 -cmd '.timer 1' -cmd '.echo 1' $db < tmp/sql < tmp/sql <> $syncflag +else + err "Account synch[$$] failed or bailed with num=[$num]" fi -err "Account synchronization done in difference $num" +test -e "$runflag" && rm -f "$runflag" return $num
World List
Base
⇒ + Base