-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix to ensure git pulls don't lockup loading
- Loading branch information
1 parent
d77d4a6
commit 31917f1
Showing
1 changed file
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
#!/bin/bash | ||
|
||
for folder in $(find /opt/ | grep '/\.git$') ; do git --git-dir=$folder pull || : ; done; | ||
TIMEOUT_DURATION=30 | ||
DELAY_DURATION=50 | ||
|
||
# Function to perform git pulls with timeout and delay | ||
perform_git_pulls() { | ||
for folder in $(find / -type d -name ".git"); do | ||
# Perform the git pull with a timeout | ||
timeout $TIMEOUT_DURATION git --git-dir="$folder" pull || : | ||
# Wait for the specified delay duration | ||
sleep $DELAY_DURATION | ||
done | ||
} | ||
|
||
# Run the perform_git_pulls function as a subprocess | ||
(perform_git_pulls &) | ||
|
||
/root/anaconda3/bin/jupyter lab --ip='*' --NotebookApp.password="${JUPYPASS}" --no-browser --port 80 --allow-root |