More stuff
This commit is contained in:
parent
71beed7eb3
commit
9a7e420c83
7 changed files with 63 additions and 33 deletions
|
@ -107,7 +107,9 @@ func (s *Storage) UpdateNote(note *Note) error {
|
|||
}
|
||||
err = s.cache.Set(cacheNoteIdToNotePrefix+note.ID, note)
|
||||
if err != nil {
|
||||
log.Warn().Err(err).Msg("Failed to update note into cache. Cache and db might be out of sync, a force sync is recommended")
|
||||
log.Warn().
|
||||
Err(err).
|
||||
Msg("Failed to update note into cache. Cache and db might be out of sync, a force sync is recommended")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -121,13 +123,3 @@ func (s *Storage) DeleteNote(id string) {
|
|||
s.cache.Delete(cacheNoteIdToNotePrefix + id)
|
||||
s.db.Delete(Note{ID: id})
|
||||
}
|
||||
|
||||
// Try and find a note with a given ID
|
||||
func (store *Storage) FindNoteById(id string) (*Note, error) {
|
||||
note := Note{}
|
||||
res := store.db.First(¬e, id)
|
||||
if res.Error != nil {
|
||||
return nil, res.Error
|
||||
}
|
||||
return ¬e, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue