文件存储-增加文件上传记录接口,增加定时同步租户文件存储容量信息接口
This commit is contained in:
35
main.go
Normal file
35
main.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
"github.com/gogf/gf/v2/os/gtimer"
|
||||
"oss/controller"
|
||||
"oss/service"
|
||||
"time"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"gitee.com/red-future---jilin-g/common/jaeger"
|
||||
_ "gitee.com/red-future---jilin-g/common/mongo"
|
||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
defer jaeger.ShutDown(ctx)
|
||||
|
||||
// 注册路由
|
||||
http.RouteRegister([]interface{}{
|
||||
controller.File,
|
||||
})
|
||||
|
||||
gtimer.AddSingleton(ctx, time.Minute*5, func(ctx context.Context) {
|
||||
err := service.TenantOssTotal.UpdateUsedOssSize(ctx)
|
||||
if err != nil {
|
||||
glog.Error(ctx, "UpdateUsedOssSize err: %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
// 保持应用运行
|
||||
select {}
|
||||
}
|
||||
Reference in New Issue
Block a user