y4shg commited on
Commit
699cdb6
·
verified ·
1 Parent(s): 184a603

Update sync.sh

Browse files
Files changed (1) hide show
  1. sync.sh +4 -2
sync.sh CHANGED
@@ -21,7 +21,9 @@ git clone "$REPO_URL" ./data/github_data || {
21
  }
22
 
23
  SOURCE_DB="$HOME/.omniroute/storage.sqlite"
 
24
 
 
25
  if [ -f ./data/github_data/storage.sqlite ]; then
26
  cp ./data/github_data/storage.sqlite "$SOURCE_DB"
27
  echo "Successfully pulled from GitHub repository"
@@ -64,9 +66,9 @@ sync_data() {
64
 
65
  cd ../..
66
  echo "Waiting 2 minutes until next sync..."
67
- sleep 120 # Wait 2 minutes
68
  done
69
  }
70
 
71
- # Start sync process in background
72
  sync_data &
 
21
  }
22
 
23
  SOURCE_DB="$HOME/.omniroute/storage.sqlite"
24
+ mkdir -p "$HOME/.omniroute"
25
 
26
+ # Initial pull — blocking, must complete before omniroute starts
27
  if [ -f ./data/github_data/storage.sqlite ]; then
28
  cp ./data/github_data/storage.sqlite "$SOURCE_DB"
29
  echo "Successfully pulled from GitHub repository"
 
66
 
67
  cd ../..
68
  echo "Waiting 2 minutes until next sync..."
69
+ sleep 120
70
  done
71
  }
72
 
73
+ # Start background sync loop then exit so omniroute can start
74
  sync_data &