more stuff
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m31s

This commit is contained in:
matst80
2024-11-14 20:13:40 +01:00
parent 1c6c9b1894
commit 9a80d74325
2 changed files with 75 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ type CartGrain struct {
Items []*CartItem `json:"items"`
TotalPrice int64 `json:"totalPrice"`
Deliveries []*CartDelivery `json:"deliveries,omitempty"`
Processing bool `json:"processing"`
}
type Grain interface {
@@ -339,6 +340,13 @@ func (c *CartGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPa
Price: 49,
Items: items,
})
c.Processing = true
go func() {
time.Sleep(5 * time.Second)
c.mu.Lock()
c.Processing = false
c.mu.Unlock()
}()
}
case RemoveDeliveryType:
msg, ok := message.Content.(*messages.RemoveDelivery)