27 lines
883 B
Go
27 lines
883 B
Go
package tasks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
|
)
|
|
|
|
func init() { RegisterInnerTask("syns_imei_queue", "SynsImeiQueue") }
|
|
|
|
// SynsImeiQueue is the scheduled entry point for the full IMEI sync.
|
|
//
|
|
// It publishes an empty scope, which the Worker treats as a full sync — the
|
|
// same contract as the status and traffic chains.
|
|
//
|
|
// The IMEI chain re-polls every card (including cards that already have a
|
|
// value), so a device swap is detected. Schedule it less often than the status
|
|
// sync: IMEI only changes when the device changes, while the fixed per-run cost
|
|
// is the same as a status run.
|
|
func (t Task) SynsImeiQueue() {
|
|
if _, err := service.ImeiQueue().StartImeiRun(context.Background()); err != nil {
|
|
g.Log().Errorf(context.Background(), "start imei queue sync failed: %+v", err)
|
|
}
|
|
}
|