mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-21 18:00:55 +00:00
Add more error handling and mutex guards
This commit is contained in:
@@ -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