challenge-sync-airbus: Use --delay-updates to avoid WRITE
This commit is contained in:
parent
c547c45d31
commit
59cf98ead2
@ -32,7 +32,7 @@ done &
|
||||
while ! [ -f SETTINGS/stop ] || [ /tmp/stop -nt SETTINGS/stop ]
|
||||
do
|
||||
# Synchronize static files pages
|
||||
rsync -e "$SSH_OPTS" -av --delete PKI TEAMS SETTINGSDIST "${FRONTEND_HOSTNAME}":"${BASEDIR}"
|
||||
rsync -e "$SSH_OPTS" -av --delete --delay-updates --partial-dir=.tmp/ PKI TEAMS SETTINGSDIST "${FRONTEND_HOSTNAME}":"${BASEDIR}"
|
||||
|
||||
# Synchronize submissions
|
||||
rsync -e "$SSH_OPTS" -av --ignore-existing --delay-updates --temp-dir=.tmp/ --partial-dir=.tmp/ --remove-source-files "${FRONTEND_HOSTNAME}":"${BASEDIR}"/submissions/ submissions/
|
||||
|
@ -411,12 +411,19 @@ func main() {
|
||||
case ev := <-watcher.Events:
|
||||
d, err := os.Lstat(ev.Name)
|
||||
|
||||
if err == nil && strings.HasPrefix(d.Name(), ".") {
|
||||
if *debugINotify {
|
||||
log.Println("Skipped event:", ev, "for", ev.Name)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if err == nil && watchedNotify == fsnotify.Create && ev.Op&fsnotify.Write == fsnotify.Write {
|
||||
log.Println("FSNOTIFY WRITE SEEN. Prefer looking at them, as it appears files are not atomically moved.")
|
||||
watchedNotify = fsnotify.Write
|
||||
}
|
||||
|
||||
if err == nil && ev.Op&fsnotify.Create == fsnotify.Create && d.Mode().IsDir() && d.Mode()&os.ModeSymlink == 0 && d.Name() != ".tmp" {
|
||||
if err == nil && ev.Op&fsnotify.Create == fsnotify.Create && d.Mode().IsDir() && d.Mode()&os.ModeSymlink == 0 {
|
||||
// Register new subdirectory
|
||||
if err := watchsubdir(watcher, ev.Name); err != nil {
|
||||
log.Println(err)
|
||||
@ -476,7 +483,7 @@ func watchsubdir(watcher *fsnotify.Watcher, pathname string) error {
|
||||
} else {
|
||||
for _, d := range ds {
|
||||
p := path.Join(pathname, d.Name())
|
||||
if d.IsDir() && d.Name() != ".tmp" && d.Mode()&os.ModeSymlink == 0 {
|
||||
if d.IsDir() && !strings.HasPrefix(d.Name(), ".") && d.Mode()&os.ModeSymlink == 0 {
|
||||
if err := watchsubdir(watcher, p); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user