瀏覽代碼

Revert "Export a fatal error handled by the hook manager"

This reverts commit 069c21974a8d36e889c73ad78023448d787d62a5.
gabrielseibel1 2 年之前
父節點
當前提交
199dc06123
共有 1 個文件被更改,包括 1 次插入13 次删除
  1. 1 13
      logic/timer.go

+ 1 - 13
logic/timer.go

@@ -2,10 +2,7 @@ package logic
 
 import (
 	"context"
-	"errors"
 	"fmt"
-	"golang.org/x/exp/slog"
-	"os"
 	"sync"
 	"time"
 
@@ -21,9 +18,6 @@ const timer_hours_between_runs = 24
 // HookManagerCh - channel to add any new hooks
 var HookManagerCh = make(chan models.HookDetails, 2)
 
-// HookManagerFatalError is an error to which is fatal to the hook manager (stops the program!)
-var HookManagerFatalError = errors.New("fatal periodic procedure")
-
 // == Public ==
 
 // TimerCheckpoint - Checks if 24 hours has passed since telemetry was last sent. If so, sends telemetry data to posthog
@@ -76,13 +70,7 @@ func addHookWithInterval(ctx context.Context, wg *sync.WaitGroup, hook func() er
 		case <-ctx.Done():
 			return
 		case <-ticker.C:
-			if err := hook(); err != nil {
-				// stop the server if there was a fatal error
-				if errors.Is(err, HookManagerFatalError) {
-					slog.Error(err.Error())
-					os.Exit(0)
-				}
-			}
+			hook()
 		}
 	}