Skip to content

Added command to schedule tasks if not ran for a specified X days#126

Merged
corpsee merged 2 commits into
php-censor:masterfrom
Vincentv92:master
Oct 5, 2017
Merged

Added command to schedule tasks if not ran for a specified X days#126
corpsee merged 2 commits into
php-censor:masterfrom
Vincentv92:master

Conversation

@Vincentv92

Copy link
Copy Markdown
Contributor

For example:

bash php bin/console php-censor:schedule-build 1
Will check if there are upcoming builds and if there are not, or they are currently not running or pending will schedule a build.

This applies to every project

/** @var Project $project */
foreach ($projects as $project) {

$latestBuild = $this->buildStore->getByProjectId($project->getId(), 1);

@corpsee corpsee Oct 5, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should use getLatestBuilds instead of getByProjectId. Because getLatestBuilds has sorting by id. Postgres doen`t guarantee order of records if no ORDER BY.

@Vincentv92

Copy link
Copy Markdown
Contributor Author

Feedback has been applied

@corpsee corpsee merged commit 3fa21f3 into php-censor:master Oct 5, 2017
@corpsee

corpsee commented Oct 5, 2017

Copy link
Copy Markdown
Member

Thanks @Vincentv92!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants