diff --git a/Sources/hyper-focus/schedule_manager.swift b/Sources/hyper-focus/schedule_manager.swift index 81d5d3b..1c935e3 100644 --- a/Sources/hyper-focus/schedule_manager.swift +++ b/Sources/hyper-focus/schedule_manager.swift @@ -95,6 +95,11 @@ class ScheduleManager { endPause = end } + func resumeBlocking() { + log("resume blocking") + endPause = nil + } + func schedules() -> [Configuration.ScheduleItem] { return configuration.schedule } diff --git a/Sources/hyper-focus/server.swift b/Sources/hyper-focus/server.swift index e9a2869..ff3bf97 100644 --- a/Sources/hyper-focus/server.swift +++ b/Sources/hyper-focus/server.swift @@ -115,9 +115,15 @@ class ApiServer { return ["status": "ok"] } + router["/resume"] = JSONResponse { _ -> Any in + log("/resume") + self.scheduleManager.resumeBlocking() + return ["status": "ok"] + } + // http -vvv POST http://localhost:8080/pause until=1667510271 router["/pause"] = JSONResponse { environ -> Any in - log("pause route") + log("/pause") var pauseUtil: Int?