feat: defer login bootstrap updates
This commit is contained in:
parent
a246fd5417
commit
4d9f1e271d
18 changed files with 958 additions and 188 deletions
39
internal/domain/bootstrap_update.go
Normal file
39
internal/domain/bootstrap_update.go
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type BootstrapUpdateJobKind string
|
||||
|
||||
const (
|
||||
BootstrapUpdateJobLoginMessage BootstrapUpdateJobKind = "login_message"
|
||||
)
|
||||
|
||||
type BootstrapUpdateJobStatus string
|
||||
|
||||
const (
|
||||
BootstrapUpdateJobPending BootstrapUpdateJobStatus = "pending"
|
||||
BootstrapUpdateJobReady BootstrapUpdateJobStatus = "ready"
|
||||
BootstrapUpdateJobPublishing BootstrapUpdateJobStatus = "publishing"
|
||||
BootstrapUpdateJobPublished BootstrapUpdateJobStatus = "published"
|
||||
BootstrapUpdateJobFailed BootstrapUpdateJobStatus = "failed"
|
||||
)
|
||||
|
||||
const BootstrapUpdateMaxAttempts = 5
|
||||
|
||||
// BootstrapUpdateJob defers first-session account updates until the client has
|
||||
// received its initial updates baseline. Pending jobs do not occupy pts.
|
||||
type BootstrapUpdateJob struct {
|
||||
ID int64
|
||||
Kind BootstrapUpdateJobKind
|
||||
UserID int64
|
||||
AuthKeyID [8]byte
|
||||
SessionID int64
|
||||
MessageBoxID int
|
||||
Status BootstrapUpdateJobStatus
|
||||
Attempts int
|
||||
LastError string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
ReadyAt time.Time
|
||||
PublishedAt time.Time
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue