Skip to content

Commit

Permalink
Warn, instead of exiting on error
Browse files Browse the repository at this point in the history
Fixes: zeerorg/cron-connector#25

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Aug 23, 2022
1 parent 2268390 commit b95598f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,15 @@ func startFunctionProbe(interval time.Duration, probeTimeout time.Duration, topi

namespaces, err := sdkClient.ListNamespaces(ctx)
if err != nil {
return fmt.Errorf("can't list namespaces: %w", err)
log.Printf("error listing namespaces: %s", err)
continue
}

for _, namespace := range namespaces {
functions, err := sdkClient.ListFunctions(ctx, namespace)
if err != nil {
return fmt.Errorf("can't list functions: %w", err)
log.Printf("error listing functions in %s: %s", namespace, err)
continue
}

newCronFunctions := requestsToCronFunctions(functions, namespace, topic)
Expand All @@ -147,7 +149,8 @@ func startFunctionProbe(interval time.Duration, probeTimeout time.Duration, topi
for _, function := range addFuncs {
f, err := cronScheduler.AddCronFunction(function, invoker)
if err != nil {
return fmt.Errorf("can't add function: %s, %w", function.String(), err)
log.Printf("can't add function: %s, %s", function.String(), err)
continue
}

newScheduledFuncs = append(newScheduledFuncs, f)
Expand Down

0 comments on commit b95598f

Please sign in to comment.