Skip to content

Commit 168f984

Browse files
committed
add a helper to restart import if it crashes
1 parent 7a7a5d1 commit 168f984

File tree

1 file changed

+24
-0
lines changed
  • typescript/packages/common-cli

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# the space should be the first argument
4+
space=$1
5+
6+
# the interval should be the second argument
7+
interval=$2
8+
9+
# if no interval is provided, use 10
10+
if [ -z "$interval" ]; then
11+
interval=10
12+
fi
13+
14+
# if no space is provided, exit
15+
if [ -z "$space" ]; then
16+
echo "No space provided"
17+
exit 1
18+
fi
19+
20+
# run the task, if it fails, wait for 10 seconds and try again
21+
while true; do
22+
deno task google-importer --space $space --interval $interval
23+
sleep $interval
24+
done

0 commit comments

Comments
 (0)