@@ -18,6 +18,10 @@ import (
18
18
ptypes "github.com/openfaas/faas-provider/types"
19
19
)
20
20
21
+ // topic is the value of the "topic" annotation to look for
22
+ // on functions, to decide to include them for invocation
23
+ const topic = "cron-function"
24
+
21
25
func main () {
22
26
config , err := getControllerConfig ()
23
27
if err != nil {
@@ -26,16 +30,15 @@ func main() {
26
30
27
31
sha , ver := version .GetReleaseInfo ()
28
32
log .Printf ("Version: %s\t Commit: %s\n " , sha , ver )
29
- log .Printf ("Gateway URL: %s" , config .GatewayURL )
30
- log .Printf ("Async Invocation: %v" , config .AsyncFunctionInvocation )
33
+ log .Printf ("Gateway URL: %s" , config .GatewayURL )
34
+ log .Printf ("Async Invocation: %v" , config .AsyncFunctionInvocation )
31
35
32
36
invoker := types .NewInvoker (gatewayRoute (config ),
33
37
types .MakeClient (config .UpstreamTimeout ),
34
38
config .ContentType ,
35
39
config .PrintResponse )
36
40
37
41
cronScheduler := cfunction .NewScheduler ()
38
- topic := "cron-function"
39
42
interval := time .Second * 10
40
43
41
44
cronScheduler .Start ()
@@ -50,6 +53,7 @@ func gatewayRoute(config *types.ControllerConfig) string {
50
53
if config .AsyncFunctionInvocation {
51
54
return fmt .Sprintf ("%s/%s" , config .GatewayURL , "async-function" )
52
55
}
56
+
53
57
return fmt .Sprintf ("%s/%s" , config .GatewayURL , "function" )
54
58
}
55
59
0 commit comments