mirror of
https://github.com/safing/portbase
synced 2025-09-13 00:30:09 +00:00
Improve database storage put method
This commit is contained in:
parent
812c1e26c5
commit
558486483b
13 changed files with 56 additions and 45 deletions
|
@ -44,12 +44,12 @@ func (hm *HashMap) Get(key string) (record.Record, error) {
|
|||
}
|
||||
|
||||
// Put stores a record in the database.
|
||||
func (hm *HashMap) Put(r record.Record) error {
|
||||
func (hm *HashMap) Put(r record.Record) (record.Record, error) {
|
||||
hm.dbLock.Lock()
|
||||
defer hm.dbLock.Unlock()
|
||||
|
||||
hm.db[r.DatabaseKey()] = r
|
||||
return nil
|
||||
return r, nil
|
||||
}
|
||||
|
||||
// PutMany stores many records in the database.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue