feat: process attachments through durable versioned jobs

This commit is contained in:
Vladislav Agapov
2026-10-29 16:56:06 +03:00
parent 276dbdad8a
commit e35c8f0b75
235 changed files with 17028 additions and 44 deletions
+25
View File
@@ -0,0 +1,25 @@
package memory
import (
"bytes"
"time"
"github.com/google/uuid"
"gitea.privcloud.tech/vlad_marlo/mtusi2026lab5/internal/model/dto"
)
// timestamp is called under the write lock, keeping append order during clock rollback.
func (s *Store) timestamp() time.Time {
now := time.Now().UTC()
if !now.After(s.lastTime) {
now = s.lastTime.Add(time.Nanosecond)
}
s.lastTime = now
return now
}
// after compares a record with a keyset pagination position.
func after(t time.Time, id uuid.UUID, p dto.PositionDTO) bool {
return t.After(p.CreatedAt) || (t.Equal(p.CreatedAt) && bytes.Compare(id[:], p.ID[:]) > 0)
}