File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,10 @@ update msg model =
137137 Lock.LockReleased { path, model = lockModel, command } ->
138138 { model = { model | locks = lockModel }
139139 , command =
140- log "Lock Released" model.stdout
140+ Cmd.batch
141+ [ log "Lock Released" model.stdout
142+ , Cmd.map LockMsg command
143+ ]
141144 }
142145
143146 Lock.AlreadyLocked path ->
Original file line number Diff line number Diff line change @@ -67,7 +67,10 @@ describe("compiler-node", () => {
6767 . cwd ( rootDir )
6868 . fork ( "bin/app" , [ "lock" , "10" ] , { } )
6969 . stdout ( "Lock Aquired" )
70- . stdout ( "Lock Released" ) ;
70+ . stdout ( "Lock Released" )
71+ . expect ( ( { assert } ) => {
72+ assert . equal ( false , fs . existsSync ( ".lock" ) )
73+ } ) ;
7174 } ) ;
7275 } ) ;
7376} ) ;
Original file line number Diff line number Diff line change @@ -133,8 +133,8 @@ update fsPerm msg model =
133133 { path = path
134134 , model = Dict.remove (Path.toPosixString lockPath) model
135135 , command =
136- FileSystem.remove fsPerm { recursive = False , ignoreErrors = False } lockPath
137- |> Task.onError (\_ -> Task.succeed lockPath)
136+ FileSystem.remove fsPerm { recursive = True , ignoreErrors = False } lockPath
137+ |> Task.onError (\err -> Task.succeed lockPath)
138138 |> Task.execute
139139 }
140140
@@ -149,7 +149,7 @@ update fsPerm msg model =
149149 LockMetaCheck { path, result = Ok { time, meta } } ->
150150 if Time.posixToMillis time - Time.posixToMillis meta.lastAccessed > 5000 then
151151 -- Lock is stale, let's try again
152- FileSystem.remove fsPerm { recursive = False , ignoreErrors = False } path
152+ FileSystem.remove fsPerm { recursive = True , ignoreErrors = False } path
153153 |> Task.onError (\_ -> Task.succeed path)
154154 |> Task.perform (\_ -> Lock (fromLockPath path))
155155 |> Working
You can’t perform that action at this time.
0 commit comments