Removed obsolete RWMutexes

This commit is contained in:
Oliver Sauder
2016-11-18 16:10:34 +01:00
committed by Lorenzo Bolla
parent 208a2151c1
commit 1e7731c317
5 changed files with 0 additions and 14 deletions

View File

@@ -166,8 +166,6 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
}
collection := collectionFactory.PublishedRepoCollection()
collection.Lock()
defer collection.Unlock()
published, err := deb.NewPublishedRepo(storage, prefix, b.Distribution, b.Architectures, components, sources, collectionFactory)
if err != nil {

View File

@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"log"
"sync"
"github.com/aptly-dev/aptly/database"
"github.com/pborman/uuid"
@@ -93,7 +92,6 @@ func (repo *LocalRepo) RefKey() []byte {
// LocalRepoCollection does listing, updating/adding/deleting of LocalRepos
type LocalRepoCollection struct {
*sync.RWMutex
db database.Storage
cache map[string]*LocalRepo
}
@@ -101,7 +99,6 @@ type LocalRepoCollection struct {
// NewLocalRepoCollection loads LocalRepos from DB and makes up collection
func NewLocalRepoCollection(db database.Storage) *LocalRepoCollection {
return &LocalRepoCollection{
RWMutex: &sync.RWMutex{},
db: db,
cache: make(map[string]*LocalRepo),
}

View File

@@ -11,7 +11,6 @@ import (
"path/filepath"
"sort"
"strings"
"sync"
"time"
"github.com/pborman/uuid"
@@ -879,7 +878,6 @@ func (p *PublishedRepo) RemoveFiles(publishedStorageProvider aptly.PublishedStor
// PublishedRepoCollection does listing, updating/adding/deleting of PublishedRepos
type PublishedRepoCollection struct {
*sync.RWMutex
db database.Storage
list []*PublishedRepo
}
@@ -887,7 +885,6 @@ type PublishedRepoCollection struct {
// NewPublishedRepoCollection loads PublishedRepos from DB and makes up collection
func NewPublishedRepoCollection(db database.Storage) *PublishedRepoCollection {
return &PublishedRepoCollection{
RWMutex: &sync.RWMutex{},
db: db,
}
}

View File

@@ -12,7 +12,6 @@ import (
"sort"
"strconv"
"strings"
"sync"
"syscall"
"time"
@@ -752,7 +751,6 @@ func (repo *RemoteRepo) RefKey() []byte {
// RemoteRepoCollection does listing, updating/adding/deleting of RemoteRepos
type RemoteRepoCollection struct {
*sync.RWMutex
db database.Storage
cache map[string]*RemoteRepo
}
@@ -760,7 +758,6 @@ type RemoteRepoCollection struct {
// NewRemoteRepoCollection loads RemoteRepos from DB and makes up collection
func NewRemoteRepoCollection(db database.Storage) *RemoteRepoCollection {
return &RemoteRepoCollection{
RWMutex: &sync.RWMutex{},
db: db,
cache: make(map[string]*RemoteRepo),
}

View File

@@ -7,7 +7,6 @@ import (
"log"
"sort"
"strings"
"sync"
"time"
"github.com/aptly-dev/aptly/database"
@@ -190,7 +189,6 @@ func (s *Snapshot) Decode(input []byte) error {
// SnapshotCollection does listing, updating/adding/deleting of Snapshots
type SnapshotCollection struct {
*sync.RWMutex
db database.Storage
cache map[string]*Snapshot
}
@@ -198,7 +196,6 @@ type SnapshotCollection struct {
// NewSnapshotCollection loads Snapshots from DB and makes up collection
func NewSnapshotCollection(db database.Storage) *SnapshotCollection {
return &SnapshotCollection{
RWMutex: &sync.RWMutex{},
db: db,
cache: map[string]*Snapshot{},
}