Skip to content

Commit

Permalink
Merge branch 'main' into chore/change_error_log
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienShui authored Oct 6, 2021
2 parents 721fd0a + 6087d98 commit 53b71a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion model/paste/temporary.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/PasteUs/PasteMeGoBackend/model/dao"
"go.uber.org/zap"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"time"
)

Expand Down Expand Up @@ -61,7 +62,7 @@ func (paste *Temporary) Expired() bool {
// Get 成员函数,查看
func (paste *Temporary) Get(password string) error {
if err := dao.DB.Transaction(func(tx *gorm.DB) error {
if e := tx.Take(&paste).Error; e != nil {
if e := tx.Clauses(clause.Locking{Strength: "UPDATE"}).Take(&paste).Error; e != nil {
return e
}

Expand Down

0 comments on commit 53b71a3

Please sign in to comment.