Skip to content

Commit

Permalink
Added cookbook item
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrizio Branca committed Mar 10, 2015
1 parent 38170a4 commit fb163de
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
10 changes: 4 additions & 6 deletions doc/tips-tricks.md → doc/declutter-timeline.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## Tips and Tricks
## Declutter your timeline view and optimize cron processing

### Declutter your timeline view and optimize cron processing

#### Replace high frequency schedules with 'always'
### Replace high frequency schedules with 'always'

Some jobs come with a high frequency schedule like `* * * * *` (or strange enough some write it as `*/1 * * * *`). Even running a job every 5 minutes (`*/5 * * * *`) can be considered a high frequency.

Expand All @@ -14,13 +12,13 @@ A good candidate for this change is **core_email_queue_send_all**. Go to 'System

![](images/always.png)

#### Disable unused jobs
### Disable unused jobs

Another candidate for this would be **newsletter_send_all**, but since you might not be sending newsletters from within Magento anyways you might want to disable this job completely:

![](images/disabled.png)

#### Only keep 20 schedules
### Only keep 20 schedules

Ideally everything works fine and you'll see only green bars in the timeline view. If you have too many jobs and decided to keep every schedule for a day or longer ("Success History Lifetime") your timeline view might take a while to load.

Expand Down
25 changes: 25 additions & 0 deletions doc/deployment-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## How to integrate Aoe_Scheduler into you deployment process

When deploying a new build to your server some tasks might still be running in the background. Here's a simple workflow to make a clean cut:

```shell
# Disable cron processing (here: using n98-magerun). This will not affect tasks that are currently running
cd $rootDir && n98-magerun.phar config:set system/cron/enable 0

# Flush all future schedules (so that no new schedule get's started)
cd $rootDir/shell && php scheduler --action flushSchedules --mode future

# Actively wait until current schedules finish for up to 1 minute (or longer if required):
cd $rootDir/shell && php scheduler --action wait --timout 60

# Kill all tasks that might still be running
cd $rootDir/shell && php scheduler --action killAll

# Deploy!

# Enable cron processing (here: using n98-magerun)
cd $rootDir && n98-magerun.phar config:set system/cron/enable 1

# New schedules will automatically be generated before the next run...

```
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Please get in touch with us via the [issue tracker on GitHub](https://github.com
1. [Domain Model](doc/domain-model.md)
1. [Cron Processing](doc/processing.md)
1. [Unit Tests](doc/tests.md)
1. [Tips and Tricks](doc/tips-tricks.md)
1. Features
1. [Heartbeat and Monitoring](doc/heartbeat.md)
1. [Notifications](doc/notifications.md)
Expand All @@ -93,6 +92,8 @@ Please get in touch with us via the [issue tracker on GitHub](https://github.com
1. [Process Management](doc/process-management.md)
1. [Output buffering](doc/output-buffering.md)
1. Cookbook
1. [How to declutter your timeline](doc/declutter-timeline.md)
1. [How to integrate into deployments](doc/deployment-integration.md)
1. [Distributed cron](doc/distributed.md)
1. [Job workflows](doc/job-workflows.md)
1. [Schedule a job programmatically](doc/programmatically.md)
Expand Down

0 comments on commit fb163de

Please sign in to comment.