MCPcopy Index your code
hub / github.com/tinode/chat / UserCacheUpdate

Method UserCacheUpdate

server/cluster.go:669–682  ·  view source on GitHub ↗

User cache & push notifications management. These are calls received by the Master from Proxy. The Proxy expects no payload to be returned by the master. UserCacheUpdate endpoint receives updates to user's cached values as well as sends push notifications.

(msg *UserCacheReq, rejected *bool)

Source from the content-addressed store, hash-verified

667
668// UserCacheUpdate endpoint receives updates to user's cached values as well as sends push notifications.
669func (c *Cluster) UserCacheUpdate(msg *UserCacheReq, rejected *bool) error {
670 if msg.Gone {
671 // User is deleted. Evict all user's sessions.
672 globals.sessionStore.EvictUser(msg.UserId, "")
673
674 if globals.cluster.isRemoteTopic(msg.UserId.UserId()) {
675 // No need to delete user's cache if user is remote.
676 return nil
677 }
678 }
679
680 usersRequestFromCluster(msg)
681 return nil
682}
683
684// Ping is a gRPC endpoint which receives ping requests from peer nodes.Used to detect node restarts.
685func (c *Cluster) Ping(ping *ClusterPing, unused *bool) error {

Callers

nothing calls this directly

Calls 4

usersRequestFromClusterFunction · 0.85
EvictUserMethod · 0.80
isRemoteTopicMethod · 0.80
UserIdMethod · 0.80

Tested by

no test coverage detected