v0.9.0 restructure for flow architecture, dirty

This commit is contained in:
2025-11-09 15:08:20 -05:00
parent dcf803bac1
commit 22652f9e53
40 changed files with 1104 additions and 1430 deletions

View File

@ -7,6 +7,8 @@ import (
"fmt"
"sync"
"time"
"logwisp/src/internal/core"
)
// Session represents a connection session.
@ -39,7 +41,7 @@ type Manager struct {
// NewManager creates a new session manager with a specified idle timeout.
func NewManager(maxIdleTime time.Duration) *Manager {
if maxIdleTime == 0 {
maxIdleTime = 30 * time.Minute // Default idle timeout
maxIdleTime = core.SessionDefaultMaxIdleTime
}
m := &Manager{
@ -233,7 +235,7 @@ func (m *Manager) UnregisterExpiryCallback(source string) {
// startCleanup initializes the periodic cleanup of idle sessions.
func (m *Manager) startCleanup() {
m.cleanupTicker = time.NewTicker(5 * time.Minute)
m.cleanupTicker = time.NewTicker(core.SessionCleanupInterval)
go func() {
for {