Skip to content

Commit

Permalink
Add IDs for postgres.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Oct 25, 2023
1 parent 4f1c3a7 commit 63f0aeb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# CakePHP QueueScheduler plugin

[![CI](https://github.com/dereuromark/cakephp-queue-scheduler/workflows/CI/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-queue-scheduler/actions?query=workflow%3ACI+branch%3Amaster)
[![Coverage Status](https://img.shields.io/codecov/c/github/dereuromark/cakephp-queue-scheduler/master.svg)](https://codecov.io/github/dereuromark/cakephp-queue-scheduler/branch/master)
[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-queue-scheduler/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-queue-scheduler)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)
[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg?style=flat)](https://phpstan.org/)
[![License](https://poser.pugx.org/dereuromark/cakephp-queue-scheduler/license)](https://packagist.org/packages/dereuromark/cakephp-queue-scheduler)
[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-queue-scheduler/d/total)](https://packagist.org/packages/dereuromark/cakephp-queue-scheduler)
[![Coding Standards](https://img.shields.io/badge/cs-PSR--2--R-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)

A scheduler addon for [Queue plugin](https://github.com/dereuromark/cakephp-queue).

This branch is for use with **CakePHP 4.4+**. For details see [version map](https://github.com/dereuromark/cakephp-queue-scheduler/wiki#cakephp-version-map).

## Installation

You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

```
composer require dereuromark/cakephp-queue-scheduler
```

## Installation and Usage
See [Documentation](docs/).
3 changes: 3 additions & 0 deletions config/Seeds/DemoSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ class DemoSeed extends AbstractSeed {
public function run(): void {
$data = [
[
'id' => 1,
'name' => 'Example Shell snippet',
'type' => \QueueScheduler\Model\Entity\Row::TYPE_SHELL_COMMAND,
'frequency' => '+10seconds',
'content' => 'uname',
'enabled' => true,
],
[
'id' => 2,
'name' => 'Example Cake Command',
'type' => \QueueScheduler\Model\Entity\Row::TYPE_CAKE_COMMAND,
'frequency' => '+1minute',
'content' => \Cake\Command\SchemacacheBuildCommand::class,
'enabled' => true,
],
[
'id' => 3,
'name' => 'Example Queue Task',
'type' => \QueueScheduler\Model\Entity\Row::TYPE_QUEUE_TASK,
'frequency' => '+30seconds',
Expand Down
24 changes: 23 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,33 @@ You can use different styles depending on your use case.
For larger time frames (e.g. months) or more complex scheduling (e.g. "every Tuesday at ...") this style is recommended.
See https://crontab.guru/ for details.

```
* * * * * /path/to/somecommand.sh
| | | | | |
| | | | | Command or Script to execute
| | | | |
| | | | Day of week(0-6 | Sun-Sat)
| | | |
| | | Month(1-12)
| | |
| | Day of Month(1-31)
| |
| Hour(0-23)
|
Min(0-59)
```

E.g. "At 04:05" each day:
```
5 4 * * *
```

### DateInterval style

They either start with a `P` or a `+`. Other values are invalid.

`P1D` or `+ 1 day` mean the same thing.
- `P1D` and `+ 1 day` mean the same thing.
- `P2W` and `+ 2 weeks` mean the same thing.

You can also define more complex intervals by chaining: `+ 1 hour + 5 minutes`.

Expand Down

0 comments on commit 63f0aeb

Please sign in to comment.