File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -405,15 +405,17 @@ data ServiceInstance = ServiceInstance
405
405
timeout :: Int -> IO a -> IO (Maybe a )
406
406
timeout usecs action = either (const Nothing ) Just <$> race (threadDelay usecs) action
407
407
408
- cleanupService :: (HasCallStack ) => ServiceInstance -> IO ()
409
- cleanupService inst = do
408
+ cleanupService :: (HasCallStack ) => Service -> String -> ServiceInstance -> IO ()
409
+ cleanupService svc domain inst = do
410
410
mPid <- getPid inst. handle
411
411
for_ mPid (signalProcess keyboardSignal)
412
412
timeout 50000 (waitForProcess inst. handle) >>= \ case
413
- Just _ -> pure ()
413
+ Just _ ->
414
+ putStrLn $ " [" <> show svc <> " @" <> domain <> " ] is dead"
414
415
Nothing -> do
415
416
for_ mPid (signalProcess killProcess)
416
417
void $ waitForProcess inst. handle
418
+ putStrLn $ " [" <> show svc <> " @" <> domain <> " ] was killed with -9"
417
419
whenM (doesFileExist inst. config) $ removeFile inst. config
418
420
whenM (doesDirectoryExist inst. config) $ removeDirectoryRecursive inst. config
419
421
@@ -468,7 +470,7 @@ withProcess resource overrides service = do
468
470
469
471
void $ Codensity $ \ k -> do
470
472
iok <- appToIOKleisli k
471
- liftIO $ E. bracket initProcess cleanupService iok
473
+ liftIO $ E. bracket initProcess ( cleanupService service domain) iok
472
474
473
475
lift $ waitUntilServiceIsUp domain service
474
476
You can’t perform that action at this time.
0 commit comments