mirror of
https://github.com/pikami/cosmium.git
synced 2026-11-04 23:45:50 +00:00
Add more error handling and mutex guards
This commit is contained in:
1 parent
d6b816b55a
commit
125f10d8a2
8 files changed
+62
-26
No files matched your search
@@ -46,8 +46,8 @@ func (r *DataRepository) LoadStateFS(filePath string) {
|
||||
}
|
||||
|
||||
func (r *DataRepository) LoadStateJSON(jsonData string) error {
|
||||
r.storeState.RLock()
|
||||
defer r.storeState.RUnlock()
|
||||
r.storeState.Lock()
|
||||
defer r.storeState.Unlock()
|
||||
|
||||
var state repositorymodels.State
|
||||
if err := json.Unmarshal([]byte(jsonData), &state); err != nil {
|
||||
|
||||
Reference in new issue
Block a user