Skip to content

Commit

Permalink
♻️ refactor: remove flock dependency
Browse files Browse the repository at this point in the history
Use an environment variable to prevent spawned shell to call abbr_tips_update again, removing flock dependency
  • Loading branch information
gazorby committed Apr 16, 2020
1 parent b490895 commit 376072d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions conf.d/abbr_tips.fish
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ end
# Prevent this file to spawn more than one subshell
if test "$USER" != 'root'
and test $ABBR_TIPS_AUTO_UPDATE = 'background'
begin
flock -n 99; or exit
and ! test $_abbr_tips_is_spawned = 1
set -gx _abbr_tips_is_spawned 1
fish -c 'abbr_tips_update' &
end 99>/tmp/abbr_fish_lock
set -e _abbr_tips_is_spawned
else if test $ABBR_TIPS_AUTO_UPDATE = 'normal'
abbr_tips_update
end

0 comments on commit 376072d

Please sign in to comment.