Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Sep 23, 2024
1 parent a5204cc commit ce1f0ec
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function supports(string $outputClass, object $data): bool
public function transform($data, string $outputClass, array &$context = []): object
{
$output = new AssetRenditionOutput();
$output->setId($data->getId());
$output->setCreatedAt($data->getCreatedAt());
$output->setUpdatedAt($data->getUpdatedAt());

Expand Down
2 changes: 1 addition & 1 deletion databox/client/src/api/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function getIntegrationsOfContext(
const res = await apiClient.get(integrationNS, {
params: {
context,
workspaceId,
workspace: workspaceId,
...data,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default function AssetTagList({tags}: Props) {
const rest = tags.length - (tagsLimit - 1);
const others =
tagsLimit > 1
? t('asset.tag_list.others', `+ {{total}} others`, {total: rest})
: t('asset.tag_list.tags', `+ {{total}} tag`, {total: rest});
? t('asset.tag_list.others', `+ {{count}} others`, {count: rest})
: t('asset.tag_list.tags', `+ {{count}} tag`, {count: rest});
const chips =
tags.length <= tagsLimit
? tags.slice(0, tagsLimit).map(r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public function removeJobState(string $workflowId, string $jobId): void
}
}

public function resetJobState(string $workflowId, string $jobId): void
{
}

public function acquireJobLock(string $workflowId, string $jobId): void
{
$this->em->beginTransaction();
Expand All @@ -87,6 +91,8 @@ public function acquireJobLock(string $workflowId, string $jobId): void
'w' => $workflowId,
'j' => $jobId,
])
->addOrderBy('t.createdAt', 'DESC')
->setMaxResults(1)
->getQuery()
->setLockMode(LockMode::PESSIMISTIC_WRITE)
->getOneOrNullResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ public function removeJobState(string $workflowId, string $jobId): void
}
}

public function resetJobState(string $workflowId, string $jobId): void
{
$this->removeJobState($workflowId, $jobId);
}

private function getWorkflowPath(string $id, string $filename): string
{
return $this->path.DIRECTORY_SEPARATOR.$id.DIRECTORY_SEPARATOR.$filename.'.state';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public function removeJobState(string $workflowId, string $jobId): void
unset($this->jobs[$workflowId][$jobId]);
}

public function resetJobState(string $workflowId, string $jobId): void
{
$this->removeJobState($workflowId, $jobId);
}

private function ensureWorkflowExists(string $workflowId): void
{
if (!isset($this->jobs[$workflowId])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ public function getJobState(string $workflowId, string $jobId): ?JobState;
public function persistJobState(JobState $state): void;

public function removeJobState(string $workflowId, string $jobId): void;

public function resetJobState(string $workflowId, string $jobId): void;
}
2 changes: 1 addition & 1 deletion lib/php/workflow/src/WorkflowOrchestrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function rerunJobs(string $workflowId, ?string $jobIdFilter = null, ?arra
try {
$jobState = $this->stateRepository->getJobState($workflowId, $jobId);
if (null !== $jobState && (null === $expectedStatuses || in_array($jobState->getStatus(), $expectedStatuses, true))) {
$this->stateRepository->removeJobState($workflowId, $jobId);
$this->stateRepository->resetJobState($workflowId, $jobId);

if (!$run->getJob()->isDisabled()) {
$jobsToTrigger[] = $jobId;
Expand Down

0 comments on commit ce1f0ec

Please sign in to comment.