refactor: 机器计划任务与流程定义关联至标签

This commit is contained in:
meilin.huang
2024-05-08 21:04:25 +08:00
parent cf5111a325
commit 1d0e91f1af
85 changed files with 586 additions and 474 deletions

View File

@@ -30,8 +30,21 @@ func Set(key string, val string, expiration time.Duration) error {
return cli.Set(context.TODO(), key, val, expiration).Err()
}
func Del(key string) {
cli.Del(context.TODO(), key)
// Del 删除key
func Del(key string) (int64, error) {
return cli.Del(context.TODO(), key).Result()
}
// DelByKeyPrefix 根据key前缀删除key
func DelByKeyPrefix(keyPrefix string) error {
res, err := cli.Keys(context.TODO(), keyPrefix+"*").Result()
if err != nil {
return err
}
for _, key := range res {
Del(key)
}
return nil
}
func HSet(key string, field string, val any) {