more files
This commit is contained in:
@@ -70,8 +70,10 @@ func (s *DiskStorage[V]) save() {
|
||||
}
|
||||
}
|
||||
}
|
||||
s.queue.Delete(id)
|
||||
return true
|
||||
})
|
||||
log.Print("Appended carts to disk")
|
||||
}
|
||||
|
||||
func (s *DiskStorage[V]) logPath(id uint64) string {
|
||||
@@ -102,7 +104,6 @@ func (s *DiskStorage[V]) Close() {
|
||||
|
||||
func (s *DiskStorage[V]) AppendEvent(id uint64, msg proto.Message) error {
|
||||
if s.queue != nil {
|
||||
|
||||
queue := make([]QueueEvent, 0)
|
||||
data, found := s.queue.Load(id)
|
||||
if found {
|
||||
@@ -112,7 +113,6 @@ func (s *DiskStorage[V]) AppendEvent(id uint64, msg proto.Message) error {
|
||||
s.queue.Store(id, queue)
|
||||
return nil
|
||||
} else {
|
||||
|
||||
path := s.logPath(id)
|
||||
fh, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user