From ede2873ccf8c1dda047e599d4b01c2364d3e5fa3 Mon Sep 17 00:00:00 2001 From: blob42 Date: Thu, 10 Oct 2024 18:34:33 +0200 Subject: [PATCH] feat[mod]: skip non browser mods in mod init Signed-off-by: blob42 --- cmd/gosuki/daemon.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/gosuki/daemon.go b/cmd/gosuki/daemon.go index 03c3241..c9186b6 100644 --- a/cmd/gosuki/daemon.go +++ b/cmd/gosuki/daemon.go @@ -139,8 +139,13 @@ func startDaemon(c *cli.Context) error { mods := modules.GetModules() for _, mod := range mods { name := mod.ModInfo().ID - log.Debugf("starting <%s>", name) modInstance := mod.ModInfo().New() + if _, ok := modInstance.(modules.BrowserModule); ok { + log.Debugf("skipping non browser module") + continue + } + + log.Debugf("starting <%s>", name) modContext := &modules.Context{ Cli: c, @@ -149,7 +154,7 @@ func startDaemon(c *cli.Context) error { // generic module need to implement watch.IntervalFetcher ifetcher, ok := modInstance.(watch.IntervalFetcher) if !ok { - log.Criticalf("module <%s> does not implement watch.Runner", name) + log.Criticalf("module <%s> does not implement watch.IntervalFetcher", name) continue } @@ -159,7 +164,6 @@ func startDaemon(c *cli.Context) error { log.Errorf("setting up <%s> %v", name, err) return err } - // panic("WIP") worker := watch.IntervalWork{ Name: string(name),