1
0
Fork 0
mirror of synced 2024-10-01 01:37:56 +13:00

Merge branch 'master' of github.com:appwrite/appwrite

This commit is contained in:
eldadfux 2019-11-26 20:55:30 +02:00
commit 50e2324304
2 changed files with 14 additions and 7 deletions

View file

@ -43,7 +43,7 @@ Table of Contents:
Appwrite backend server is designed to run in a container environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool like Kubernetes, Docker Swarm or Rancher.
The easiest way to start running your Appwrite server is by running our docker-compose file:
The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine:
```bash
mkdir appwrite-ce && \
@ -103,7 +103,7 @@ For security issues, kindly email us [security@appwrite.io](mailto:security@appw
## Follow Us
Join our growing community around the world! Follow us on [Twitter](https://twitter.com/appwrite_io), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) or join our live [Gitter community](https://gitter.im/appwrite/community) for more help, ideas, and discussions.
Join our growing community around the world! Follow us on [Twitter](https://twitter.com/appwrite_io), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/) or join our live [Discord server](https://discord.gg/GSeTUeA) for more help, ideas, and discussions.
## Contributing

View file

@ -23,7 +23,7 @@ class TasksV1
public function perform()
{
global $consoleDB, $register, $version;
global $consoleDB, $version;
/*
* 1. Get Original Task
@ -44,6 +44,9 @@ class TasksV1
$delay = time() - $next;
$errors = [];
$timeout = 60 * 5; // 5 minutes
$errorLimit = 5;
$logLimit = 5;
$alert = '';
if (empty($taskId)) {
throw new Exception('Missing task $id');
@ -78,7 +81,7 @@ class TasksV1
->setAttribute('previous', time())
;
ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy());
ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); // Async task rescheduale
$startTime = microtime(true);
@ -147,15 +150,15 @@ class TasksV1
} else {
$task
->setAttribute('failures', $task->getAttribute('failures', 0) + 1)
->setAttribute('status', ($task->getAttribute('failures') >= 5) ? 'pause' : 'play')
->setAttribute('status', ($task->getAttribute('failures') >= $errorLimit) ? 'pause' : 'play')
;
$alert = 'Task "'.$task->getAttribute('name').'" failed to execute with the following errors: '.implode($errors, "\n");
$alert = 'Task "'.$task->getAttribute('name').'" failed to execute with the following errors: '.implode("\n", $errors);
}
$log = json_decode($task->getAttribute('log', '{}'), true);
if (count($log) >= 5) {
if (count($log) >= $logLimit) {
array_pop($log);
}
@ -182,6 +185,10 @@ class TasksV1
Authorization::enable();
// ResqueScheduler::enqueueAt($next, 'v1-tasks', 'TasksV1', $task->getArrayCopy()); // Sync task rescheduale
// Send alert if needed (use SMTP as default for now)
return true;
}