Skip to content

Commit

Permalink
fixbug-limit-sql
Browse files Browse the repository at this point in the history
  • Loading branch information
bingxindan committed Jul 18, 2023
1 parent 6b672ee commit 873d4b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions store/postgresql/ratelimit_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (rls *rateLimitStore) CreateRateLimit(limit *model.RateLimit) error {
}

func limitToEtimeStr(limit *model.RateLimit) string {
etimeStr := "sysdate()"
etimeStr := GetCurrentTimeFormat()
if limit.Disable {
etimeStr = emptyEnableTime
}
Expand All @@ -72,9 +72,9 @@ func (rls *rateLimitStore) createRateLimit(limit *model.RateLimit) error {

etimeStr := limitToEtimeStr(limit)
// 新建限流规则
str := fmt.Sprintf(`insert into ratelimit_config(
id, name, disable, service_id, method, labels, priority, rule, revision, ctime, mtime, etime)
values($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11, %s)`, etimeStr)
str := fmt.Sprintf("insert into ratelimit_config(id, name, disable, service_id, "+
"method, labels, priority, rule, revision, ctime, mtime, etime) "+
"values($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11, %s)", etimeStr)
stmt, err := tx.Prepare(str)
if err != nil {
return err
Expand Down

0 comments on commit 873d4b8

Please sign in to comment.