Commit cb513b1b authored by Linshizhi's avatar Linshizhi

Function rename.

parent b6424823
Pipeline #32121 canceled with stages
......@@ -34,8 +34,8 @@ monitorUrls = [
defaultMI "http://69.234.216.199:5001/ppt2newdraft"
]
buildCMD :: WebHook -> Msg -> String
buildCMD wh msg =
cmdFactory :: WebHook -> Msg -> String
cmdFactory wh msg =
"curl " ++ wh ++
" -H 'Content-Type: application/json'" ++
" -d '" ++
......@@ -63,7 +63,7 @@ onFailure mi = do
doNotify :: IO MonitorItem
doNotify = do
let cmd = buildCMD webHook ("Fail to access api " ++ url mi)
let cmd = cmdFactory webHook ("Fail to access api " ++ url mi)
current <- getCurrentTime
-- FIXME: system may failed need to check it's return code
system cmd >> return (MI (url mi) False current)
......@@ -73,7 +73,7 @@ onSuccess mi = do
current <- getCurrentTime
if not $ status mi
then do let cmd = buildCMD webHook ("Api has recovered: " ++ url mi)
then do let cmd = cmdFactory webHook ("Api has recovered: " ++ url mi)
system cmd >> return (MI (url mi) True current)
else return mi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment