Merge remote-tracking branch 'origin/main'

# Conflicts:
#	controller/relay.go
#	main.go
#	middleware/distributor.go
This commit is contained in:
CaIon
2023-09-09 03:15:55 +08:00
26 changed files with 1027 additions and 187 deletions

View File

@@ -78,6 +78,12 @@ func main() {
go controller.AutomaticallyTestChannels(frequency)
}
go controller.UpdateMidjourneyTask()
if os.Getenv("BATCH_UPDATE_ENABLED") == "true" {
common.BatchUpdateEnabled = true
common.SysLog("batch update enabled with interval " + strconv.Itoa(common.BatchUpdateInterval) + "s")
model.InitBatchUpdater()
}
controller.InitTokenEncoders()
// Initialize HTTP server
server := gin.Default()