2026-07-27 08:16:20 +12:00
|
|
|
// Command memby-server is the Memby gateway: one HTTP service in front of Emby that
|
|
|
|
|
// owns auth, caching and the shaping of TV screens, so the Android client can stay thin.
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2026-08-02 22:10:19 +12:00
|
|
|
"encoding/json"
|
2026-07-27 08:16:20 +12:00
|
|
|
"errors"
|
|
|
|
|
"flag"
|
|
|
|
|
"fmt"
|
|
|
|
|
"log/slog"
|
|
|
|
|
"net/http"
|
|
|
|
|
"os"
|
|
|
|
|
"os/signal"
|
|
|
|
|
"strings"
|
|
|
|
|
"syscall"
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/ponzischeme89/memby/server/internal/api"
|
2026-08-06 22:33:56 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/bazarr"
|
|
|
|
|
"github.com/ponzischeme89/memby/server/internal/buildinfo"
|
2026-07-27 08:16:20 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/cache"
|
|
|
|
|
"github.com/ponzischeme89/memby/server/internal/config"
|
|
|
|
|
"github.com/ponzischeme89/memby/server/internal/emby"
|
2026-07-29 15:26:27 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/foryou"
|
2026-07-27 08:16:20 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/library"
|
2026-07-27 21:06:51 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/logging"
|
2026-08-03 08:52:55 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/mdblist"
|
2026-08-02 22:10:19 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/radarr"
|
2026-07-27 08:16:20 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/recommend"
|
2026-07-27 21:06:51 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/sonarr"
|
2026-07-27 08:16:20 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/store"
|
2026-07-29 15:26:27 +12:00
|
|
|
"github.com/ponzischeme89/memby/server/internal/tracearr"
|
2026-07-27 08:16:20 +12:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
// A distroless image has no shell or curl, so the container's healthcheck re-runs
|
|
|
|
|
// this binary with -healthcheck and it probes itself over the loopback interface.
|
|
|
|
|
healthcheck := flag.Bool("healthcheck", false, "probe the local /healthz endpoint and exit")
|
|
|
|
|
flag.Parse()
|
|
|
|
|
if *healthcheck {
|
|
|
|
|
if err := probeHealth(); err != nil {
|
|
|
|
|
os.Stderr.WriteString(err.Error() + "\n")
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-27 21:06:51 +12:00
|
|
|
logLevel := logging.ParseLevel(os.Getenv("MEMBY_LOG_LEVEL"))
|
2026-08-02 22:10:19 +12:00
|
|
|
logCapacity := logging.ParseCapacity(os.Getenv("MEMBY_LOG_BUFFER_CAPACITY"), 5_000)
|
2026-08-06 22:33:56 +12:00
|
|
|
logFormat := logging.ParseFormat(os.Getenv("MEMBY_LOG_FORMAT"))
|
2026-08-12 09:57:56 +12:00
|
|
|
logHistoryPath := strings.TrimSpace(os.Getenv("MEMBY_LOG_HISTORY_PATH"))
|
|
|
|
|
if logHistoryPath == "" {
|
|
|
|
|
logHistoryPath = "/data/logs/events.jsonl"
|
|
|
|
|
}
|
|
|
|
|
log, events, err := logging.NewPersistentBuffered(
|
|
|
|
|
os.Stdout, logLevel, logCapacity, logFormat, logHistoryPath,
|
|
|
|
|
)
|
|
|
|
|
if err != nil {
|
|
|
|
|
os.Stderr.WriteString("open persistent log history: " + err.Error() + "\n")
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
defer events.Close()
|
2026-08-06 22:33:56 +12:00
|
|
|
// Every line names the build that wrote it. A gateway is deployed from a working
|
|
|
|
|
// tree, often while a television is running an older app, so "which server said
|
|
|
|
|
// this" is a real question that a reader should never have to scroll for.
|
|
|
|
|
log = log.With("version", buildinfo.Version())
|
2026-07-27 08:16:20 +12:00
|
|
|
|
2026-07-29 15:26:27 +12:00
|
|
|
if err := run(log, events); err != nil {
|
2026-07-27 08:16:20 +12:00
|
|
|
log.Error("fatal", "error", err)
|
|
|
|
|
os.Exit(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-29 15:26:27 +12:00
|
|
|
func run(log *slog.Logger, events *logging.Buffer) error {
|
2026-07-27 08:16:20 +12:00
|
|
|
cfg, err := config.Load()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
|
|
|
|
defer stop()
|
|
|
|
|
|
|
|
|
|
// Postgres may still be starting when compose brings us up; retry briefly rather
|
|
|
|
|
// than crash-looping the container.
|
|
|
|
|
st, err := openStore(ctx, cfg.DatabaseURL, log)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
defer st.Close()
|
|
|
|
|
|
|
|
|
|
if err := st.Migrate(ctx); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ca, err := cache.Open(cfg.RedisURL)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
defer ca.Close()
|
|
|
|
|
if err := ca.Ping(ctx); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// A run interrupted by a restart is still marked "running" in the database; clear
|
|
|
|
|
// those before anything reads the sync history.
|
|
|
|
|
if err := st.MarkStaleRunsFailed(ctx); err != nil {
|
|
|
|
|
log.Warn("could not clear interrupted sync runs", "error", err)
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-12 13:08:53 +12:00
|
|
|
embyClient := emby.New(
|
|
|
|
|
cfg.EmbyURL, cfg.EmbyPublicURL, cfg.ClientName, cfg.GatewayClientName,
|
|
|
|
|
cfg.UpstreamTimeout,
|
|
|
|
|
)
|
2026-08-03 08:52:55 +12:00
|
|
|
mdblistClient := mdblist.New(mdblist.DefaultBaseURL, cfg.UpstreamTimeout)
|
2026-07-27 21:06:51 +12:00
|
|
|
var sonarrClient *sonarr.Client
|
|
|
|
|
if cfg.SonarrURL != "" {
|
|
|
|
|
sonarrClient = sonarr.New(cfg.SonarrURL, cfg.SonarrAPIKey, cfg.UpstreamTimeout)
|
|
|
|
|
log.Info("sonarr integration enabled", "url", cfg.SonarrURL)
|
|
|
|
|
}
|
2026-08-02 22:10:19 +12:00
|
|
|
var radarrClient *radarr.Client
|
|
|
|
|
if cfg.RadarrURL != "" {
|
|
|
|
|
radarrClient = radarr.New(cfg.RadarrURL, cfg.RadarrAPIKey, cfg.UpstreamTimeout)
|
|
|
|
|
log.Info("radarr integration enabled", "url", cfg.RadarrURL)
|
|
|
|
|
}
|
2026-08-06 22:33:56 +12:00
|
|
|
// Bazarr gets its own timeout rather than UpstreamTimeout: a manual search queries
|
|
|
|
|
// live subtitle providers and legitimately takes tens of seconds, and cutting it short
|
|
|
|
|
// reads to the viewer as "no subtitles found" rather than as a timeout.
|
|
|
|
|
var bazarrClient *bazarr.Client
|
|
|
|
|
if cfg.BazarrURL != "" {
|
|
|
|
|
bazarrClient = bazarr.New(cfg.BazarrURL, cfg.BazarrAPIKey, cfg.BazarrTimeout)
|
|
|
|
|
log.Info("bazarr integration enabled", "url", cfg.BazarrURL)
|
|
|
|
|
}
|
2026-07-27 08:16:20 +12:00
|
|
|
|
2026-08-06 22:33:56 +12:00
|
|
|
recommender := recommend.NewEngine(embyClient, log.With("component", "recommendations"))
|
2026-08-02 22:10:19 +12:00
|
|
|
if cfg.RecommendationWeights != "" {
|
|
|
|
|
_ = json.Unmarshal([]byte(cfg.RecommendationWeights), &recommender.WeightedConfig)
|
|
|
|
|
}
|
2026-07-27 08:16:20 +12:00
|
|
|
// Candidates come from the imported library when one exists, which keeps the
|
|
|
|
|
// recommendation rebuild off Emby entirely.
|
|
|
|
|
recommender.Library = st
|
2026-07-29 15:26:27 +12:00
|
|
|
recommender.Behavior = st
|
|
|
|
|
var tracearrClient *tracearr.Client
|
|
|
|
|
if cfg.TracearrURL != "" {
|
|
|
|
|
tracearrClient = tracearr.New(
|
|
|
|
|
cfg.TracearrURL,
|
|
|
|
|
cfg.TracearrAPIKey,
|
|
|
|
|
cfg.TracearrServerID,
|
|
|
|
|
cfg.UpstreamTimeout,
|
|
|
|
|
)
|
|
|
|
|
recommender.Tracearr = tracearrClient
|
|
|
|
|
log.Info("tracearr recommendation signals enabled", "url", cfg.TracearrURL)
|
|
|
|
|
}
|
2026-07-27 08:16:20 +12:00
|
|
|
|
|
|
|
|
syncer := library.NewSyncer(embyClient, st, emby.Credentials{
|
|
|
|
|
UserID: cfg.SyncUserID,
|
|
|
|
|
Token: cfg.SyncAPIKey,
|
|
|
|
|
DeviceID: "memby-gateway-sync",
|
2026-08-12 13:08:53 +12:00
|
|
|
Gateway: true,
|
2026-08-06 22:33:56 +12:00
|
|
|
}, log.With("component", "library"))
|
2026-07-29 15:26:27 +12:00
|
|
|
var forYouService *foryou.Service
|
|
|
|
|
if tracearrClient != nil {
|
|
|
|
|
forYouService = foryou.New(
|
2026-08-06 22:33:56 +12:00
|
|
|
st, tracearrClient, recommender, log.With("component", "for-you"),
|
2026-07-29 15:26:27 +12:00
|
|
|
cfg.ForYouMinRebuildAge, cfg.ForYouRefreshInterval,
|
|
|
|
|
)
|
2026-08-02 22:10:19 +12:00
|
|
|
forYouService.ConfigureTimeContext(cfg.SonarrLocation)
|
2026-07-29 15:26:27 +12:00
|
|
|
forYouService.ConfigureHouseholdUsers(embyClient, emby.Credentials{
|
|
|
|
|
UserID: cfg.SyncUserID, Token: cfg.SyncAPIKey,
|
2026-08-12 13:08:53 +12:00
|
|
|
DeviceID: "memby-for-you-builder", DeviceName: "MbyGateway For You",
|
|
|
|
|
Gateway: true,
|
2026-07-29 15:26:27 +12:00
|
|
|
})
|
|
|
|
|
}
|
2026-07-27 08:16:20 +12:00
|
|
|
|
|
|
|
|
server := api.New(cfg, api.Deps{
|
|
|
|
|
Emby: embyClient,
|
|
|
|
|
Store: st,
|
|
|
|
|
Cache: ca,
|
|
|
|
|
Recommender: recommender,
|
2026-07-29 15:26:27 +12:00
|
|
|
ForYou: forYouService,
|
2026-07-27 21:06:51 +12:00
|
|
|
Sonarr: sonarrClient,
|
2026-08-02 22:10:19 +12:00
|
|
|
Radarr: radarrClient,
|
2026-08-06 22:33:56 +12:00
|
|
|
Bazarr: bazarrClient,
|
2026-08-03 08:52:55 +12:00
|
|
|
MDBList: mdblistClient,
|
2026-07-27 08:16:20 +12:00
|
|
|
Syncer: syncer,
|
|
|
|
|
Log: log,
|
2026-07-29 15:26:27 +12:00
|
|
|
Events: events,
|
2026-07-27 08:16:20 +12:00
|
|
|
})
|
|
|
|
|
|
2026-08-02 22:10:19 +12:00
|
|
|
// Installed after the server exists, because both halves of a finished import are
|
|
|
|
|
// its business: derived data has to be invalidated, and the TVs told the catalogue
|
|
|
|
|
// moved. Kept off the syncer itself so library stays ignorant of the API.
|
|
|
|
|
syncer.SetAfterSync(func(result library.Result) {
|
|
|
|
|
afterCtx, cancel := context.WithTimeout(context.Background(), cfg.RecommendTimeout)
|
|
|
|
|
defer cancel()
|
|
|
|
|
server.AnnounceLibrarySync(afterCtx, result)
|
|
|
|
|
if forYouService == nil || (result.Changed == 0 && result.Removed == 0) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
forYouService.MarkAllDirty(afterCtx)
|
|
|
|
|
})
|
|
|
|
|
|
2026-07-27 08:16:20 +12:00
|
|
|
if err := server.LoadMaintenance(ctx); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
go server.WatchMaintenance(ctx, 30*time.Second)
|
2026-08-02 22:10:19 +12:00
|
|
|
// One probe per gateway, not per TV: the answer is the same for the whole house.
|
|
|
|
|
go server.WatchEmbyReachability(ctx, cfg.EmbyHealthInterval)
|
2026-08-11 23:41:10 +12:00
|
|
|
// One Sonarr catalogue reading per day records lifecycle changes for the household and
|
|
|
|
|
// materialises cancellation notifications for every known viewer.
|
|
|
|
|
go server.WatchSonarrLifecycle(ctx, 24*time.Hour)
|
2026-07-27 08:16:20 +12:00
|
|
|
|
2026-07-27 08:34:04 +12:00
|
|
|
if err := server.LoadUpdatePolicy(ctx); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
go server.WatchUpdatePolicy(ctx, 60*time.Second)
|
|
|
|
|
|
2026-07-27 08:16:20 +12:00
|
|
|
go syncer.Schedule(ctx, cfg.SyncInterval)
|
|
|
|
|
if cfg.SyncOnStart {
|
|
|
|
|
go func() {
|
|
|
|
|
if _, err := syncer.Sync(ctx, "incremental", "startup"); err != nil {
|
|
|
|
|
log.Warn("startup sync failed", "error", err)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
}
|
2026-07-29 15:26:27 +12:00
|
|
|
if forYouService != nil {
|
|
|
|
|
go forYouService.Schedule(
|
|
|
|
|
ctx,
|
|
|
|
|
cfg.TracearrSyncInterval,
|
|
|
|
|
cfg.TracearrFullInterval,
|
2026-08-02 22:10:19 +12:00
|
|
|
cfg.ForYouRebuildHour,
|
2026-07-29 15:26:27 +12:00
|
|
|
)
|
|
|
|
|
go func() {
|
|
|
|
|
importCtx, cancel := context.WithTimeout(ctx, cfg.SyncTimeout)
|
2026-08-06 22:33:56 +12:00
|
|
|
// Only if one is actually owed. An unconditional startup import made every
|
|
|
|
|
// redeploy or container bounce a fresh pass over Tracearr's history.
|
|
|
|
|
if _, _, err := forYouService.ImportIfDue(
|
|
|
|
|
importCtx, cfg.TracearrSyncInterval, cfg.TracearrFullInterval,
|
|
|
|
|
); err != nil {
|
2026-08-02 22:10:19 +12:00
|
|
|
cancel()
|
2026-07-29 15:26:27 +12:00
|
|
|
log.Warn("startup Tracearr import failed", "error", err)
|
|
|
|
|
return
|
|
|
|
|
}
|
2026-08-02 22:10:19 +12:00
|
|
|
cancel()
|
|
|
|
|
// Only an algorithm-version change warrants startup work. Normal dirty
|
|
|
|
|
// profiles wait for the daily off-peak rebuild.
|
|
|
|
|
rebuildCtx, rebuildCancel := context.WithTimeout(ctx, cfg.SyncTimeout)
|
|
|
|
|
defer rebuildCancel()
|
|
|
|
|
if err := forYouService.RebuildOutdated(rebuildCtx); err != nil {
|
|
|
|
|
log.Warn("startup outdated For You rebuild failed", "error", err)
|
2026-07-29 15:26:27 +12:00
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
}
|
2026-07-27 08:16:20 +12:00
|
|
|
go pruneAnalytics(ctx, st, cfg.AnalyticsRetention, log)
|
|
|
|
|
|
|
|
|
|
httpServer := &http.Server{
|
|
|
|
|
Addr: cfg.ListenAddr,
|
|
|
|
|
Handler: server.Routes(),
|
|
|
|
|
ReadHeaderTimeout: 10 * time.Second,
|
|
|
|
|
// No WriteTimeout: image proxying streams bodies of unpredictable size.
|
|
|
|
|
IdleTimeout: 60 * time.Second,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
go sweepIdleSessions(ctx, st, cfg.SessionIdleExpiry, log)
|
|
|
|
|
|
|
|
|
|
errCh := make(chan error, 1)
|
|
|
|
|
go func() {
|
2026-08-06 22:33:56 +12:00
|
|
|
log.Info("gateway ready",
|
2026-07-27 21:06:51 +12:00
|
|
|
"listen", cfg.ListenAddr,
|
|
|
|
|
"emby", cfg.EmbyURL,
|
2026-08-06 22:33:56 +12:00
|
|
|
"protocol", api.ProtocolVersion,
|
2026-07-27 21:06:51 +12:00
|
|
|
"sync_every", cfg.SyncInterval,
|
|
|
|
|
)
|
2026-07-27 08:16:20 +12:00
|
|
|
if err := httpServer.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
|
|
|
|
|
errCh <- err
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
select {
|
|
|
|
|
case err := <-errCh:
|
|
|
|
|
return err
|
|
|
|
|
case <-ctx.Done():
|
|
|
|
|
log.Info("shutting down")
|
|
|
|
|
shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
|
|
|
|
defer cancel()
|
|
|
|
|
return httpServer.Shutdown(shutdownCtx)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// probeHealth is the container healthcheck: hit our own /healthz over loopback.
|
|
|
|
|
func probeHealth() error {
|
|
|
|
|
addr := os.Getenv("MEMBY_LISTEN_ADDR")
|
|
|
|
|
if addr == "" {
|
|
|
|
|
addr = ":8080"
|
|
|
|
|
}
|
2026-07-29 15:26:27 +12:00
|
|
|
// Wildcard listen addresses still mean "connect to localhost" from in here.
|
2026-07-27 08:16:20 +12:00
|
|
|
if idx := strings.LastIndex(addr, ":"); idx >= 0 {
|
|
|
|
|
addr = "127.0.0.1" + addr[idx:]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
client := &http.Client{Timeout: 3 * time.Second}
|
|
|
|
|
resp, err := client.Get("http://" + addr + "/healthz")
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
defer resp.Body.Close()
|
|
|
|
|
if resp.StatusCode != http.StatusOK {
|
|
|
|
|
return fmt.Errorf("healthz returned %d", resp.StatusCode)
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func openStore(ctx context.Context, databaseURL string, log *slog.Logger) (*store.Store, error) {
|
|
|
|
|
var lastErr error
|
|
|
|
|
for attempt := range 10 {
|
|
|
|
|
st, err := store.Open(ctx, databaseURL)
|
|
|
|
|
if err == nil {
|
|
|
|
|
return st, nil
|
|
|
|
|
}
|
|
|
|
|
lastErr = err
|
|
|
|
|
log.Warn("waiting for postgres", "attempt", attempt+1, "error", err)
|
|
|
|
|
select {
|
|
|
|
|
case <-ctx.Done():
|
|
|
|
|
return nil, ctx.Err()
|
|
|
|
|
case <-time.After(2 * time.Second):
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nil, lastErr
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-10 20:24:22 +12:00
|
|
|
// pruneAnalytics keeps raw engagement and journey events inside their retention window.
|
2026-07-27 08:16:20 +12:00
|
|
|
func pruneAnalytics(ctx context.Context, st *store.Store, retention time.Duration, log *slog.Logger) {
|
|
|
|
|
if retention <= 0 {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
ticker := time.NewTicker(24 * time.Hour)
|
|
|
|
|
defer ticker.Stop()
|
|
|
|
|
for {
|
|
|
|
|
select {
|
|
|
|
|
case <-ctx.Done():
|
|
|
|
|
return
|
|
|
|
|
case <-ticker.C:
|
|
|
|
|
removed, err := st.PruneRowEvents(ctx, retention)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Warn("analytics prune failed", "error", err)
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
if removed > 0 {
|
|
|
|
|
log.Info("pruned row events", "count", removed)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// sweepIdleSessions retires gateway tokens that have not been used in a long time, so a
|
|
|
|
|
// TV that was factory-reset does not leave a live Emby token in the database forever.
|
|
|
|
|
func sweepIdleSessions(ctx context.Context, st *store.Store, idle time.Duration, log *slog.Logger) {
|
|
|
|
|
ticker := time.NewTicker(6 * time.Hour)
|
|
|
|
|
defer ticker.Stop()
|
|
|
|
|
for {
|
|
|
|
|
select {
|
|
|
|
|
case <-ctx.Done():
|
|
|
|
|
return
|
|
|
|
|
case <-ticker.C:
|
|
|
|
|
removed, err := st.DeleteIdleSessions(ctx, idle)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Warn("session sweep failed", "error", err)
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
if removed > 0 {
|
|
|
|
|
log.Info("retired idle sessions", "count", removed)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|