s4
changeset 881:a240c8988c65
Save profile update time stamp in user_s table
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Wed, 16 Dec 2020 08:55:04 +0900 |
parents | fa5be649968f |
children | a46e85d50954 |
files | s4-funcs.sh s4-world.sh |
diffstat | 2 files changed, 10 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/s4-funcs.sh Mon Dec 14 20:01:07 2020 +0900 1.2 +++ b/s4-funcs.sh Wed Dec 16 08:55:04 2020 +0900 1.3 @@ -4244,7 +4244,15 @@ 1.4 RELEASE SAVEPOINT pa2table_insert; 1.5 EOF 1.6 rc=$? 1.7 - [ $rc -eq 0 -a x"$tbl" = x"user" ] && touch $userupdateflag 1.8 + if [ $rc -eq 0 -a x"$tbl" = x"user" ]; then 1.9 + # XXX: Sorry to use undeclared column in user.def 1.10 + # This is useful to mitigate account sync load 1.11 + query <<-EOF 1.12 + REPLACE INTO user_s(name, key, type, val) 1.13 + VALUES('$user', 'profupdate', 'string', datetime('now', 'localtime')); 1.14 + EOF 1.15 + touch $userupdateflag 1.16 + fi 1.17 ## err "Table:$tbl update done " 1.18 return $rc 1.19 )
2.1 --- a/s4-world.sh Mon Dec 14 20:01:07 2020 +0900 2.2 +++ b/s4-world.sh Wed Dec 16 08:55:04 2020 +0900 2.3 @@ -88,7 +88,7 @@ 2.4 else 2.5 case "$prevsync" in 2.6 [2-9][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]\ [012][0-9]:??:??) 2.7 - SYNCCOND="WHERE name in (SELECT name FROM m.user_s WHERE key='wtime' AND val > '$prevsync')" 2.8 + SYNCCOND="WHERE name in (SELECT name FROM m.user_s WHERE key='profupdate' AND val > '$prevsync')" 2.9 err "prevsync=$prevsync" 2.10 limited=`query "SELECT DISTINCT name FROM m.user_s $SYNCCOND;"` 2.11 if [ -n "$limited" ]; then