Skip to content

Commit

Permalink
fix: use new context for log in transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina committed Jun 14, 2024
1 parent 46b0d35 commit 68ad2d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/relation/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s Service) Create(ctx context.Context, rel RelationV2) (RelationV2, error)
}

go func() {
ctx := context.WithoutCancel(ctx)
ctx := context.TODO()
relationLogData := createdRelation.ToLogData()
actor := activity.Actor{ID: currentUser.ID, Email: currentUser.Email}
if err := s.activityService.Log(ctx, auditKeyRelationCreate, actor, relationLogData); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/resource/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (s Service) Create(ctx context.Context, res Resource) (Resource, error) {
}

go func() {
ctx := context.WithoutCancel(ctx)
ctx := context.TODO()
resourceLogData := newResource.ToLogData()
actor := activity.Actor{ID: currentUser.ID, Email: currentUser.Email}
if err := s.activityService.Log(ctx, auditKeyResourceCreate, actor, resourceLogData); err != nil {
Expand Down

0 comments on commit 68ad2d4

Please sign in to comment.