21 lines
495 B
Go
21 lines
495 B
Go
package outbound
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/cmd/inithttp"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/rabbitmq"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
func init() {
|
|
inithttp.RegisterHttpInitFunc("outboundBatchQueue", func(ctx context.Context) error {
|
|
if !rabbitmq.Enabled(ctx) {
|
|
g.Log().Warning(ctx, "outbound batch queue is disabled because RabbitMQ is not configured")
|
|
return nil
|
|
}
|
|
return ConsumeAsync(ctx)
|
|
})
|
|
}
|