mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Don't use transactions when direct db access is enough
For read-only action transactions are not necessary and they risk to deadlock if multiple go-routines try to read the database.
This commit is contained in:
@@ -201,3 +201,13 @@ func (s *LocalRepoCollectionSuite) TestDrop(c *C) {
|
||||
|
||||
c.Check(s.collection.Drop(repo1), ErrorMatches, "local repo not found")
|
||||
}
|
||||
|
||||
func (s *LocalRepoCollectionSuite) TestDropNonExisting(c *C) {
|
||||
repo := NewLocalRepo("local3", "Comment 3")
|
||||
|
||||
_, err := s.collection.ByUUID(repo.UUID)
|
||||
c.Check(err, ErrorMatches, "local repo .* not found")
|
||||
|
||||
err = s.collection.Drop(repo)
|
||||
c.Check(s.collection.Drop(repo), ErrorMatches, "local repo not found")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user