MCPcopy Create free account
hub / github.com/astercloud/aster / Update

Method Update

pkg/session/inmemory.go:72–87  ·  view source on GitHub ↗

Update 更新会话

(ctx context.Context, req *UpdateRequest)

Source from the content-addressed store, hash-verified

70
71// Update 更新会话
72func (s *InMemoryService) Update(ctx context.Context, req *UpdateRequest) error {
73 s.mu.Lock()
74 defer s.mu.Unlock()
75
76 session, ok := s.sessions[req.SessionID]
77 if !ok {
78 return ErrSessionNotFound
79 }
80
81 if req.Metadata != nil {
82 maps.Copy(session.metadata, req.Metadata)
83 }
84
85 session.lastUpdateTime = time.Now()
86 return nil
87}
88
89// Delete 删除会话
90func (s *InMemoryService) Delete(ctx context.Context, sessionID string) error {

Callers 1

mainFunction · 0.95

Calls 1

CopyMethod · 0.80

Tested by

no test coverage detected