Compare commits
4 Commits
d29693343b
...
ops-test-0
| Author | SHA1 | Date | |
|---|---|---|---|
| eb2722d8a0 | |||
| 2500cce6d4 | |||
| c423211cb6 | |||
| d2ba827829 |
@@ -15,9 +15,9 @@ MicroService:
|
||||
- files.ping.hello
|
||||
|
||||
ServiceClients:
|
||||
assets: ops-assets
|
||||
dc-control: ops-dc-control
|
||||
visual: ops-visual
|
||||
assets: ${ASSETS_FILES_SECRET}
|
||||
dc-control: ${DC_CONTROL_FILES_SECRET}
|
||||
visual: ${VISUAL_FILES_SECRET}
|
||||
|
||||
ObjectStorage:
|
||||
Provider: aliyun
|
||||
|
||||
@@ -15,9 +15,9 @@ MicroService:
|
||||
- files.ping.hello
|
||||
|
||||
ServiceClients:
|
||||
assets: ops-assets
|
||||
dc-control: ops-dc-control
|
||||
visual: ops-visual
|
||||
assets: ${ASSETS_FILES_SECRET}
|
||||
dc-control: ${DC_CONTROL_FILES_SECRET}
|
||||
visual: ${VISUAL_FILES_SECRET}
|
||||
|
||||
ObjectStorage:
|
||||
Provider: aliyun
|
||||
|
||||
@@ -15,9 +15,9 @@ MicroService:
|
||||
- files.ping.hello
|
||||
|
||||
ServiceClients:
|
||||
assets: ops-assets
|
||||
dc-control: ops-dc-control
|
||||
visual: ops-visual
|
||||
assets: ${ASSETS_FILES_SECRET}
|
||||
dc-control: ${DC_CONTROL_FILES_SECRET}
|
||||
visual: ${VISUAL_FILES_SECRET}
|
||||
|
||||
ObjectStorage:
|
||||
Provider: aliyun
|
||||
|
||||
@@ -1,14 +1,28 @@
|
||||
[Unit]
|
||||
Description=Files Service
|
||||
After=network.target
|
||||
Description=OPS Files Service
|
||||
Wants=network-online.target
|
||||
Requires=ops-visual.service
|
||||
After=network-online.target ops-visual.service
|
||||
PartOf=ops-stack.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=ops
|
||||
WorkingDirectory=/opt/ops/files
|
||||
ExecStart=/opt/ops/files/ops-files
|
||||
WorkingDirectory=/data/app
|
||||
EnvironmentFile=/data/app/etc/ops.env
|
||||
Environment=BSM_RuntimeMode=prod
|
||||
Environment=RUN_MODE=prod
|
||||
Environment=BSM_Prefix=/data/app
|
||||
ExecStart=/data/app/ops-files
|
||||
ExecStartPost=/data/app/systemd/wait-http.sh ops-files http://127.0.0.1:12452/Files/v1/ping/hello 60
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
TimeoutStartSec=75s
|
||||
TimeoutStopSec=30s
|
||||
KillSignal=SIGTERM
|
||||
StandardOutput=append:/data/app/logs/files.log
|
||||
StandardError=inherit
|
||||
SyslogIdentifier=ops-files
|
||||
LimitNOFILE=1048576
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=ops-stack.target
|
||||
|
||||
@@ -3,6 +3,8 @@ package impl
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/cache/redis"
|
||||
"git.apinb.com/bsm-sdk/core/logger"
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
"git.apinb.com/bsm-sdk/core/with"
|
||||
"git.apinb.com/ops/files/internal/config"
|
||||
"git.apinb.com/ops/files/internal/storage"
|
||||
@@ -20,7 +22,13 @@ var (
|
||||
|
||||
// NewImpl 初始化各类服务实例。
|
||||
func NewImpl() {
|
||||
DBService = with.Databases(config.Spec.Databases, nil)
|
||||
DBService = with.Databases(config.Spec.Databases, &types.SqlOptions{
|
||||
MaxIdleConns: vars.SqlOptionMaxIdleConns,
|
||||
MaxOpenConns: vars.SqlOptionMaxOpenConns,
|
||||
ConnMaxLifetime: vars.SqlOptionConnMaxLifetime,
|
||||
LogStdout: false,
|
||||
Debug: false,
|
||||
})
|
||||
|
||||
var err error
|
||||
StorageService, err = storage.New(config.Spec.ObjectStorage)
|
||||
|
||||
@@ -41,7 +41,7 @@ func CompleteUpload(ctx *gin.Context) {
|
||||
Updates(map[string]any{
|
||||
"status": models.FileStatusReady,
|
||||
"actual_size": objectInfo.Size,
|
||||
"etag": objectInfo.ETag,
|
||||
"e_tag": objectInfo.ETag,
|
||||
"completed_at": completedAt,
|
||||
})
|
||||
if result.Error != nil {
|
||||
|
||||
Reference in New Issue
Block a user