File size: 517 Bytes
216f5cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"pplx2api/config"
	"pplx2api/job"
	"pplx2api/router"
	"time"

	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	// Load configuration

	// Setup all routes
	router.SetupRoutes(r)
	// 创建会话更新器,设置更新间隔为24小时
	sessionUpdater := job.GetSessionUpdater(24 * time.Hour)

	// 启动会话更新器
	sessionUpdater.Start()
	defer sessionUpdater.Stop()

	// Run the server on 0.0.0.0:8080
	r.Run(config.ConfigInstance.Address)
}