Skip to content

Commit

Permalink
PR Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hr2904 committed Jan 22, 2025
1 parent 9bf9002 commit ec6dab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public abstract class ClassificationTask extends AbstractTask {
public static final String PARAM_PREVIOUS_CLASSIFICATION_RESTRICT_PROPAGATE_THROUGH_LINEAGE = "previousRestrictPropagationThroughLineage";

public static final String PARAM_PREVIOUS_CLASSIFICATION_RESTRICT_PROPAGATE_THROUGH_HIERARCHY = "previousRestrictPropagationThroughHierarchy";
public static final String X_ATLAN_TASK_GUID = "x-atlan-task-guid";

protected final AtlasGraph graph;
protected final EntityGraphMapper entityGraphMapper;
Expand Down Expand Up @@ -98,7 +97,6 @@ public AtlasTask.Status perform() throws AtlasBaseException {
}

RequestContext.get().setUser(userName, null);
RequestContext.get().addRequestContextHeader(X_ATLAN_TASK_GUID, getTaskGuid());

try {
setStatus(IN_PROGRESS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* limitations under the License.
*/
package org.apache.atlas.tasks;
import org.apache.atlas.RequestContext;

import org.apache.atlas.model.tasks.AtlasTask;
import org.slf4j.Logger;
Expand All @@ -27,12 +28,15 @@ public abstract class AbstractTask {
private static final Logger LOG = LoggerFactory.getLogger(AbstractTask.class);
private final AtlasTask task;

public static final String X_ATLAN_TASK_GUID = "x-atlan-task-guid";

public AbstractTask(AtlasTask task) {
this.task = task;
}

public void run() throws Exception {
try {
RequestContext.get().addRequestContextHeader(X_ATLAN_TASK_GUID, getTaskGuid());
perform();
} catch (Exception exception) {
task.setStatus(Status.FAILED);
Expand Down

0 comments on commit ec6dab5

Please sign in to comment.