Merge branch 'songquanpeng:main' into main

This commit is contained in:
quzard 2023-06-22 00:55:00 +08:00 committed by GitHub
commit 5e62997207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package common
import (
"os"
"sync"
"time"
@ -67,6 +68,8 @@ var PreConsumedQuota = 500
var RootUserEmail = ""
var IsMasterNode = os.Getenv("SYNC_FREQUENCY") == ""
const (
RoleGuestUser = 0
RoleCommonUser = 1

View File

@ -55,6 +55,9 @@ func InitDB() (err error) {
}
if err == nil {
DB = db
if !common.IsMasterNode {
return nil
}
err := db.AutoMigrate(&Channel{})
if err != nil {
return err