Skip to content

Commit

Permalink
Merge branch 'cron-bundle'
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed Jan 18, 2020
2 parents f8a2924 + 81b1f18 commit e23aa29
Show file tree
Hide file tree
Showing 16 changed files with 414 additions and 123 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ php bin/console fos:user:promote <username> ROLE_ADMIN
Enable crontab `crontab -e -u www-data`

```
*/30 * * * * /var/www/packagist/bin/console --env=prod packagist:update >> /dev/null
0 0 * * * /var/www/packagist/bin/console --env=prod packagist:stats:compile >> /dev/null
* * * * * /var/www/packagist/bin/console --env=prod okvpn:cron >> /dev/null
```

Setup Supervisor to run worker.
Expand Down
3 changes: 2 additions & 1 deletion app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ public function registerBundles()
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Snc\RedisBundle\SncRedisBundle(),
new Okvpn\Bundle\CronBundle\OkvpnCronBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Packagist\WebBundle\PackagistWebBundle(),
];

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
if ($this->getEnvironment() === 'dev') {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
if (class_exists('Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle')) {
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
Expand Down
14 changes: 14 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ fos_user:
form:
type: Packagist\WebBundle\Form\Type\ProfileFormType

okvpn_cron:
tasks:
-
command: 'packagist:stats:compile'
cron: '0 0 * * *'
-
command: 'packagist:update'
cron: '*/10 * * * *'

default_policy:
lock: true
with_stamps:
- Packagist\WebBundle\Cron\WorkerStamp

packagist_web:
archive: true
archive_options:
Expand Down
2 changes: 1 addition & 1 deletion app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ monolog:
verbosity_levels:
VERBOSITY_VERBOSE: INFO
VERBOSITY_VERY_VERBOSE: DEBUG
channels: ["!doctrine"]
channels: ["!doctrine", "!php"]
console_very_verbose:
type: console
bubble: false
Expand Down
35 changes: 18 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,30 @@
},
"require": {
"php": ">=7.2",
"symfony/symfony": "^3.4",
"symfony/http-client": "^5.0",
"doctrine/orm": "^2.6",
"cebe/markdown": "^1.1",
"composer/composer": "^1.9",
"doctrine/doctrine-bundle": "^1.2",
"doctrine/doctrine-cache-bundle": "^1.3",
"twig/extensions": "^1.0",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^3.1",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0",
"oro/doctrine-extensions": "^1.2",
"composer/composer": "^1.9",
"doctrine/orm": "^2.6",
"ezyang/htmlpurifier": "^4.6",
"friendsofsymfony/user-bundle": "^2.1",
"incenteev/composer-parameter-handler": "^2.0",
"knplabs/knp-menu-bundle": "^2.1",
"okvpn/cron-bundle": "^0.1.0",
"oro/doctrine-extensions": "^1.2",
"pagerfanta/pagerfanta": "^1.0",
"predis/predis": "^1.0",
"seld/signal-handler": "^1.1",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0",
"snc/redis-bundle": "^2.0",
"symfony/http-client": "^5.0",
"symfony/monolog-bundle": "^3.1",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/symfony": "^3.4",
"twig/extensions": "^1.0",
"white-october/pagerfanta-bundle": "^1.0",
"zendframework/zend-feed": "^2.0",
"pagerfanta/pagerfanta": "^1.0",
"knplabs/knp-menu-bundle": "^2.1",
"ezyang/htmlpurifier": "^4.6",
"cebe/markdown": "^1.1",
"seld/signal-handler": "^1.1",
"incenteev/composer-parameter-handler": "^2.0"
"zendframework/zend-feed": "^2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^2.7 || ^3.0",
Expand Down
Loading

0 comments on commit e23aa29

Please sign in to comment.