1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

storage_suite: refactor to use common struct param (#492)

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2024-02-16 16:11:07 -08:00
committed by GitHub
parent 0361e971e0
commit f76b93a8f2
3 changed files with 181 additions and 147 deletions

View File

@@ -82,6 +82,7 @@ func (s *Store) AddMessage(message storage.Message) (id string, err error) {
m.id = id
m.source = source
mb.messages[id] = m
if s.cap > 0 {
// Enforce cap.
for len(mb.messages) > s.cap {