Unverified Commit d46ce81b authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub
Browse files

Merge pull request #138 from dilallkx/kd_sp39_dev_max_sessions

Configurable Maximum Session Count
parents d8a6a55a 9ccca5ef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ spec:
          env:
            {{- range $key, $value := .Values.image.env }}
            - name: {{ $key }}
              value: {{ $value }}
              value: {{ $value | quote }}
            {{- end }}
            {{- if .Values.user.frontend.enabled}}
            - name: USER_FRONTEND
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ image:
  pullPolicy: Always
  env:
    MEEP_SESSION_KEY: "my-secret-key"
    MEEP_MAX_SESSIONS: "10"

service:
  type: ClusterIP
+30 −0
Original line number Diff line number Diff line
@@ -597,6 +597,36 @@ services:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'

#   #------------------------------
#   #  WAI Service
#   #------------------------------
#   meep-wais:
#     # REST API endpoint routes: names provided to endpoint routes during router initialization
#     Index:
#       # access authorization mode: allow|block|verify
#       mode: 'block'
#     ApInfoGET:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'
#     StaInfoGET:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'
#     SubscriptionLinkListSubscriptionsGET:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'
#     SubscriptionsGET:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'
#     SubscriptionsPOST:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'
#     SubscriptionsPUT:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'
#     SubscriptionsSubscrIdDELETE:
#       # access authorization mode: allow|block|verify
#       mode: 'allow'

#   #------------------------------
#   #  Sandbox Controller
#   #------------------------------
+1 −0
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ func Init() (err error) {
		log.Error("Failed connection to Redis DB. Error: ", err)
		return err
	}
	_ = rc.DBFlush(baseKey)
	log.Info("Connected to Redis DB, location service table")

	// Connect to Session Manager
+9 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import (
	"io/ioutil"
	"math/rand"
	"net/http"
	"os"
	"strconv"
	"time"

	"github.com/gorilla/mux"
@@ -51,6 +53,7 @@ type PlatformCtrl struct {
	sandboxStore  *ss.SandboxStore
	userStore     *users.Connector
	mqGlobal      *mq.MsgQueue
	maxSessions   int
}

const scenarioDBName = "scenarios"
@@ -82,6 +85,12 @@ func Init() (err error) {
	// Create new Platform Controller
	pfmCtrl = new(PlatformCtrl)

	// Retrieve maximum session count from environment variable
	if maxSessions, err := strconv.ParseInt(os.Getenv("MEEP_MAX_SESSIONS"), 10, 0); err == nil {
		pfmCtrl.maxSessions = int(maxSessions)
	}
	log.Info("MEEP_MAX_SESSIONS: ", pfmCtrl.maxSessions)

	// Create message queue
	pfmCtrl.mqGlobal, err = mq.NewMsgQueue(mq.GetGlobalName(), moduleName, moduleNamespace, redisDBAddr)
	if err != nil {
Loading