MCPcopy Create free account
hub / github.com/Scalingo/cli / StickySession

Function StickySession

apps/routing_settings.go:33–52  ·  view source on GitHub ↗
(ctx context.Context, appName string, enable bool)

Source from the content-addressed store, hash-verified

31}
32
33func StickySession(ctx context.Context, appName string, enable bool) error {
34 c, err := config.ScalingoClient(ctx)
35 if err != nil {
36 return errors.Wrapf(ctx, err, "fail to get Scalingo client")
37 }
38 _, err = c.AppsStickySession(ctx, appName, enable)
39 if err != nil {
40 return errors.Wrapf(ctx, err, "fail to configure sticky-session feature")
41 }
42
43 var action string
44 if enable {
45 action = "enable"
46 } else {
47 action = "disable"
48 }
49
50 io.Statusf("Sticky session has been %sd on %s\n", action, appName)
51 return nil
52}
53
54func RouterLogs(ctx context.Context, appName string, enable bool) error {
55 c, err := config.ScalingoClient(ctx)

Callers 1

Calls 2

ScalingoClientFunction · 0.92
StatusfFunction · 0.92

Tested by

no test coverage detected