feat: able to send alert message via message pusher (close #993)

This commit is contained in:
JustSong
2024-03-10 19:16:06 +08:00
parent 71c61365eb
commit 5b50eb94e5
12 changed files with 161 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/songquanpeng/one-api/common"
"github.com/songquanpeng/one-api/common/config"
"github.com/songquanpeng/one-api/common/logger"
"github.com/songquanpeng/one-api/common/message"
"github.com/songquanpeng/one-api/controller"
"github.com/songquanpeng/one-api/middleware"
"github.com/songquanpeng/one-api/model"
@@ -87,6 +88,7 @@ func main() {
logger.SysLog("metric enabled, will disable channel if too much request failed")
}
openai.InitTokenEncoders()
_ = message.SendMessage("One API", "", fmt.Sprintf("One API %s started", common.Version))
// Initialize HTTP server
server := gin.New()