sync: 同步 v1.0.4 开源代码并脱敏

This commit is contained in:
MiFaZhan
2026-10-29 14:52:43 +08:00
parent 32e4316ee4
commit 6893e21f07
136 changed files with 9851 additions and 436 deletions
+18
View File
@@ -53,6 +53,7 @@ import (
monthlyhistoryservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/monthlyusagehistory"
packagecustomerservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/packagecustomer"
renewchangeservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/renewchange"
rolesyncservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/rolesync"
simstatusservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/simstatus"
trafficcutoffconfigservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/trafficcutoffconfig"
trafficusageservice "git.5iot.com/iotlcm-public/iotlcm-worker-svr/internal/service/trafficusage"
@@ -621,6 +622,7 @@ func Run(ctx context.Context) error {
if imeiProducer != nil {
rabbitMQConsumers.WithImeiQueue(imeiProducer)
}
rabbitMQConsumers.WithDataReviewQuery(dataExecutor)
var (
fullSyncHTTP *httpapi.Server
fullSyncArchives []*fullsyncarchive.Service
@@ -698,6 +700,14 @@ func Run(ctx context.Context) error {
batchDispatcher.Register(consts.BatchTypeDataCut, dataExecutor)
batchDispatcher.Register(consts.BatchTypeDataStart, dataExecutor)
batchDispatcher.Register(consts.BatchTypeDataStop, dataExecutor)
// Resume durable APN sub-batches independently of RabbitMQ delivery and process restarts.
if reconciler, ok := dataExecutor.(interface{ RunReconciler(context.Context) error }); ok {
go func() {
if err := reconciler.RunReconciler(workerCtx); err != nil && workerCtx.Err() == nil {
g.Log().Errorf(workerCtx, "APN operation reconciler stopped: %v", err)
}
}()
}
batchDispatcher.Register(consts.BatchTypeSimCardUnsub, unsubExecutor)
batchDispatcher.Register(consts.BatchTypeSimCardRestart, restartExecutor)
batchDispatcher.Register(consts.BatchTypeSimCardCancel, cancelExecutor)
@@ -708,9 +718,17 @@ func Run(ctx context.Context) error {
return gerror.Wrap(err, "start RabbitMQ consumers failed")
}
stopRoleSync, err := rolesyncservice.Start(workerCtx)
if err != nil {
_ = rabbitMQConsumers.Stop(context.Background())
return gerror.Wrap(err, "start role sync Worker failed")
}
defer stopRoleSync()
g.Log().Info(workerCtx, "iotlcm worker started")
<-workerCtx.Done()
g.Log().Info(ctx, "iotlcm worker stopping")
stopRoleSync()
shutdownCtx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
defer cancel()