diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-06-13 20:18:05 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-06-13 20:18:10 -0400 |
commit | 9c90526a24f32a00ad35073a09839189eb8aa007 (patch) | |
tree | cd8aa746d88512bb44a1c8e69f73a4e63e7af772 /svc/sqlite.go | |
parent | 88dbd876a9635fa515ed29875816d05975272597 (diff) | |
download | getwtxt-9c90526a24f32a00ad35073a09839189eb8aa007.tar.gz |
removed mutex from remoteRegistries
slices are safe to use concurrently already. leaving as a struct for possible expansion later.
Diffstat (limited to 'svc/sqlite.go')
-rw-r--r-- | svc/sqlite.go | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/svc/sqlite.go b/svc/sqlite.go index dd6d6de..b10e5ae 100644 --- a/svc/sqlite.go +++ b/svc/sqlite.go @@ -73,12 +73,10 @@ func (lite *dbSqlite) push() error { } twtxtCache.Mu.RUnlock() - remoteRegistries.Mu.RLock() for _, e := range remoteRegistries.List { _, err = txst.Exec(e, false, "REMOTE REGISTRY", "NULL") errLog("", err) } - remoteRegistries.Mu.RUnlock() err = tx.Commit() if err != nil { @@ -110,9 +108,7 @@ func (lite *dbSqlite) pull() { errLog("", rows.Scan(&uid, &urls, &isUser, &dataKey, &dBlob)) if !isUser { - remoteRegistries.Mu.Lock() remoteRegistries.List = append(remoteRegistries.List, urls) - remoteRegistries.Mu.Unlock() continue } @@ -142,7 +138,5 @@ func (lite *dbSqlite) pull() { } twtxtCache.Mu.Unlock() - remoteRegistries.Mu.Lock() remoteRegistries.List = dedupe(remoteRegistries.List) - remoteRegistries.Mu.Unlock() } |