8000 Add support for scheduled executions by Meldiron · Pull Request #8243 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for scheduled executions #8243

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

Merged
merged 27 commits into from
Jul 3, 2024
Merged

Conversation

Meldiron
Copy link
Contributor
@Meldiron Meldiron commented Jun 7, 2024

What does this PR do?

Adds parameter to createExecution to allow execution in the future, similarly to how messages can also be scheduled for later.

Fixes #5489

Test Plan

  • Implement tests

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@Meldiron Meldiron marked this pull request as draft June 7, 2024 19:06
@loks0n loks0n marked this pull request as ready for review June 11, 2024 12:57
@loks0n loks0n requested review from christyjacob4 June 11, 2024 14:59
Copy link
Contributor Author
@Meldiron Meldiron left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +4553 to +4563
[
'$id' => ID::custom('data'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 65535,
'signed' => true,
'required' => false,
'default' => new \stdClass(),
'array' => false,
'filters' => ['json', 'encrypt'],
],
Copy link
Member

Choose a reason for hiding this comment

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

Will we need a migration for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to add a column, but it doesn't require migration - patch script is enough. Like we did for some billing columns and tables.

Comment on lines +1775 to +1785
$dbForConsole->createDocument('schedules', new Document([
'region' => System::getEnv('_APP_REGION', 'default'),
'resourceType' => 'execution',
'resourceId' => $execution->getId(),
'resourceInternalId' => $execution->getInternalId(),
'resourceUpdatedAt' => DateTime::now(),
'projectId' => $project->getId(),
'schedule' => $scheduledAt,
'data' => $data,
'active' => true,
]));
Copy link
Member

Choose a reason for hiding this comment

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

If logging is false for the function, we'll create a schedule, but the execution won't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In another PR, for 1.6, we are making it so logging=false still creates document. We can ignore this bug, as it wont be there once all PRs are merged.

Copy link
Member
@lohanidamodar lohanidamodar left a comment

Choose a reason for hiding this comment

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

Approving this for Q/A release, confirming that the naming changes required will be taken care of during QA week.

@lohanidamodar lohanidamodar merged commit b3ff29d into 1.6.x Jul 3, 2024
23 checks passed
@stnguyen90 stnguyen90 changed the title Feat: Scheduled executions (execute later) Add support for scheduled executions Sep 18, 2024
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.

7 participants
0