Skip minio check (#2281)

* If MinIO is not being used, then do not perform the MinIO check.

* If MinIO is not being used, then do not perform the MinIO check.

* If MinIO is not being used, then do not perform the MinIO check.

* If MinIO is not being used, then do not perform the MinIO check.

* kill binary before build

* Stop the process before compiling.

* Stop the process before compiling.
This commit is contained in:
skiffer-git
2024-05-07 21:05:41 +08:00
committed by GitHub
parent 691cf740af
commit 8d84e2f01f
6 changed files with 25 additions and 31 deletions
+1 -13
View File
@@ -25,8 +25,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"os"
"os/signal"
"syscall"
"time"
"github.com/openimsdk/tools/errs"
@@ -50,22 +48,12 @@ func Start(ctx context.Context, config *CronTaskConfig) error {
return errs.WrapMsg(err, "failed to register discovery service")
}
client.AddOption(mw.GrpcClient(), grpc.WithTransportCredentials(insecure.NewCredentials()))
ctx, exitBy := context.WithCancelCause(context.Background())
ctx = mcontext.SetOpUserID(ctx, config.Share.IMAdminUserID[0])
conn, err := client.GetConn(ctx, config.Share.RpcRegisterName.Msg)
if err != nil {
return err
}
cli := msg.NewMsgClient(conn)
go func() {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGTERM)
select {
case <-ctx.Done():
case s := <-sigs:
exitBy(fmt.Errorf("exit signal %s", s))
}
}()
crontab := cron.New()
clearFunc := func() {
now := time.Now()
@@ -84,5 +72,5 @@ func Start(ctx context.Context, config *CronTaskConfig) error {
log.ZInfo(ctx, "start cron task", "chatRecordsClearTime", config.CronTask.ChatRecordsClearTime)
crontab.Start()
<-ctx.Done()
return context.Cause(ctx)
return nil
}