Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue detailed statuses #15

Merged
merged 8 commits into from
Mar 22, 2025
Merged

Conversation

krystian-panek-vmltech
Copy link
Collaborator

No description provided.

@@ -8,14 +8,27 @@
import org.apache.sling.event.jobs.Job;

public enum ExecutionStatus {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just expanded ACTIVE into PARSING,CHECKING,RUNNING;
ACTIVE remains because I need something for warmup/init time (opening resource resolver etc; and we don't know if when sling job says ACTIVE then our async groovy execution starts immediately)

}

switch (job.getJobState()) {
case QUEUED:
return ExecutionStatus.QUEUED;
case ACTIVE:
return ExecutionStatus.ACTIVE;
return executor.checkStatus(job.getId()).orElse(ExecutionStatus.ACTIVE);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if executor has not yet registered ID in in-memory map we assume that it is an init phase (ACTIVE status)

statuses.put(context.getId(), ExecutionStatus.PARSING);

if (context.getOutputStream() != null) {
context.setOutputStream(new TeeOutputStream(outputStream, context.getOutputStream()));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allows to write somewhere else optionally / future hook

)}
</>
);
return <Meter aria-label={label} variant={variant} showValueLabel={false} value={100} label={`${label} after ${formatter.durationShort(execution.duration)}`} />;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think aria-label is necessary if label is defined


const formatter = useFormatter();
if (!execution) {
return <Meter aria-label={label} label={label} showValueLabel={false} value={0} />;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think aria-label is necessary if label is defined

@krystian-panek-vmltech krystian-panek-vmltech merged commit 9b34994 into main Mar 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants