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

Refactor functions worker #4659

Merged
merged 34 commits into from
Nov 16, 2022
Merged

Conversation

shimonewman
Copy link
Contributor

Refactoring functions worker

app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
bin/schedule Outdated Show resolved Hide resolved
@shimonewman shimonewman changed the base branch from feat-db-pools-eldad to refactor-scheduler November 10, 2022 13:14
app/controllers/api/functions.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/workers/functions.php Outdated Show resolved Hide resolved
app/workers/functions.php Outdated Show resolved Hide resolved
app/workers/functions.php Outdated Show resolved Hide resolved
app/workers/functions.php Outdated Show resolved Hide resolved
app/workers/functions.php Outdated Show resolved Hide resolved
app/init.php Outdated Show resolved Hide resolved
app/worker.php Outdated Show resolved Hide resolved
app/worker.php Outdated Show resolved Hide resolved
$connection = $pools->get('queue')->pop();
$functions = new Func($connection->getResource());
$functions
->setData(\json_encode($data))
Copy link
Member

Choose a reason for hiding this comment

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

We dont need to set data. We need to set the payload for events

app/init.php Outdated
@@ -563,6 +565,7 @@ function (mixed $value) {
$dsns = $connection['dsns'] ?? '';
$multipe = $connection['multiple'] ?? false;
$schemes = $connection['schemes'] ?? [];
$useResource = $connection['useResource'] ?? true;
Copy link
Member

Choose a reason for hiding this comment

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

This is unused. lets remove it

app/worker.php Outdated
Console::error('[Error] File: ' . $error->getFile());
Console::error('[Error] Line: ' . $error->getLine());

$register->get('pools')->reclaim();
Copy link
Member

Choose a reason for hiding this comment

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

lets remove this. We dont use any pools here

app/worker.php Outdated
->error()
->inject('error')
->inject('logger')
->inject('register')
Copy link
Member

Choose a reason for hiding this comment

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

lets remove this injection as well

app/worker.php Outdated
$log->setVersion($version);
$log->setType(Log::TYPE_ERROR);
$log->setMessage($error->getMessage());
$log->setAction('appwrite-worker-functions');
Copy link
Member

Choose a reason for hiding this comment

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

This is no longer appwrite-worker-functions

@christyjacob4 christyjacob4 merged commit 0c759e9 into refactor-scheduler Nov 16, 2022
@stnguyen90 stnguyen90 deleted the refactor-functions-worker branch February 14, 2023 00:38
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.

None yet

4 participants