feat: implement submission repository and service layers with caching support
All checks were successful
Build and Release / release (push) Successful in 1m27s
All checks were successful
Build and Release / release (push) Successful in 1m27s
This commit is contained in:
@@ -317,7 +317,9 @@ func (r *submissionRepository) Delete(ctx context.Context, id pgtype.UUID) error
|
|||||||
|
|
||||||
_ = r.c.Del(ctx, fmt.Sprintf("submission:id:%s", convert.UUIDToString(id)))
|
_ = r.c.Del(ctx, fmt.Sprintf("submission:id:%s", convert.UUIDToString(id)))
|
||||||
go func() {
|
go func() {
|
||||||
_ = r.c.DelByPattern(context.Background(), "submission:count*")
|
bgCtx := context.Background()
|
||||||
|
_ = r.c.DelByPattern(bgCtx, "submission:search*")
|
||||||
|
_ = r.c.DelByPattern(bgCtx, "submission:count*")
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -825,5 +825,7 @@ func (s *submissionService) DeleteSubmission(ctx context.Context, userID string,
|
|||||||
return fiber.NewError(fiber.StatusInternalServerError, "Failed to delete submission")
|
return fiber.NewError(fiber.StatusInternalServerError, "Failed to delete submission")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ = s.c.Del(ctx, fmt.Sprintf("project:id:%s", submission.ProjectID))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user