mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-05-29 01:45:35 +02:00
(Hopefully) remove statsQueue races
This commit is contained in:
parent
22c66203a0
commit
9e9caee639
4 changed files with 23 additions and 24 deletions
user
|
@ -554,10 +554,10 @@ func TestManager_EnqueueStats(t *testing.T) {
|
|||
require.Nil(t, err)
|
||||
require.Equal(t, int64(0), u.Stats.Messages)
|
||||
require.Equal(t, int64(0), u.Stats.Emails)
|
||||
|
||||
u.Stats.Messages = 11
|
||||
u.Stats.Emails = 2
|
||||
a.EnqueueStats(u)
|
||||
a.EnqueueStats(u.ID, &Stats{
|
||||
Messages: 11,
|
||||
Emails: 2,
|
||||
})
|
||||
|
||||
// Still no change, because it's queued asynchronously
|
||||
u, err = a.User("ben")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue