Skip to content

Commit

Permalink
Revert "Copy RealmId when passing it to TaskExecutorImpl (#879)"
Browse files Browse the repository at this point in the history
This reverts commit febe4e8.
  • Loading branch information
Yufei Gu committed Jan 31, 2025
1 parent 569bf02 commit 8fff253
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ static RealmId newRealmId(String id) {
return ImmutableRealmId.of(id);
}

static RealmId copyOf(RealmId realmId) {
return ImmutableRealmId.copyOf(realmId);
}

@Value.Parameter
@JsonValue
String id();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ public void addTaskHandler(TaskHandler taskHandler) {
*/
@Override
public void addTaskHandlerContext(long taskEntityId, RealmId realmId) {
// Realm id is a request-scoped component, so we need to copy it to ensure it is available when
// the task is executed, even if the original realm id is no longer available because the
// request has completed.
tryHandleTask(taskEntityId, RealmId.copyOf(realmId), null, 1);
tryHandleTask(taskEntityId, realmId, null, 1);
}

private @Nonnull CompletableFuture<Void> tryHandleTask(
Expand Down

0 comments on commit 8fff253

Please sign in to comment.