Skip to content

Commit 53b0fc7

Browse files
committed
Warn, instead of exiting on error
Fixes: zeerorg/cron-connector#25 Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 2268390 commit 53b0fc7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,15 @@ func startFunctionProbe(interval time.Duration, probeTimeout time.Duration, topi
122122

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

128129
for _, namespace := range namespaces {
129130
functions, err := sdkClient.ListFunctions(ctx, namespace)
130131
if err != nil {
131-
return fmt.Errorf("can't list functions: %w", err)
132+
log.Printf("error listing functions in %s: %s", namespace, err)
133+
continue
132134
}
133135

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

153156
newScheduledFuncs = append(newScheduledFuncs, f)

0 commit comments

Comments
 (0)