Skip to content

Commit

Permalink
fix: wrong query to fetch valid jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
TiSiE committed May 13, 2020
1 parent 8bbed5c commit 023e679
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Controller/Plugin/AaResponseProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function process()
}

if ($errXml->ErrorCode == 'FLR_DataStore_110') {
echo "Job [ " . $meta->getJobId() . " ] already online. Set actrion to update.\n";
echo "Job [ " . $meta->getJobId() . " ] already online. Set action to update.\n";
$meta->updateStatus(JobMetaStatus::ONLINE, 'Already online on AA.');
$meta->setForceUpdate();
continue;
Expand All @@ -140,7 +140,7 @@ public function process()

echo "-- Process valid jobs\n";
$metas = $this->repository->createQueryBuilder()
->field('status.name')->in([
->field('status.state')->in([
JobMetaStatus::PENDING_ONLINE,
JobMetaStatus::PENDING_OFFLINE,
])
Expand Down
2 changes: 1 addition & 1 deletion src/JobFetcher/OrganizationJobFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function fetch(): iterable
|| ($jobMeta->hasStatus(JobMetaStatus::OFFLINE) && !$job->isActive())
|| (
$jobMeta->hasStatus(JobMetaStatus::ONLINE)
&& $job->isActive() && $job->getDateModified() <= $jobMeta->getDateModified()
&& $job->isActive() && $job->getDateModified() < $jobMeta->getDateModified()
&& !$jobMeta->mustUpdate()
)
) {
Expand Down
6 changes: 5 additions & 1 deletion src/JobFetcher/OrganizationJobFetcherFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace ExportBA\JobFetcher;

use ExportBA\Entity\JobMetaData;
use Interop\Container\ContainerInterface;

/**
Expand All @@ -27,8 +28,11 @@ public function __invoke(
?string $requestedName = null,
?array $options = null
): OrganizationJobFetcher {
$repos = $container->get('repositories');

return new OrganizationJobFetcher(
$container->get('repositories')->get('Jobs'),
$repos->get('Jobs'),
$repos->get(JobMetaData::class),
$options
);
}
Expand Down

0 comments on commit 023e679

Please sign in to comment.