Compare commits
11 Commits
a3477629fb
...
feat/monit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2289156f57 | ||
|
|
f42b5a9cf5 | ||
| 214f470e77 | |||
|
|
345434c25d | ||
| 2868772f5c | |||
| a2469b6c07 | |||
|
|
926f938c45 | ||
| 5551d73962 | |||
| 395a0a16cb | |||
|
|
8e2e608ad9 | ||
| 0f80cb9fec |
@@ -108,9 +108,6 @@ RUN composer install --no-cache --prefer-dist --no-dev --no-autoloader --no-scri
|
|||||||
FROM node:22-alpine AS node_build
|
FROM node:22-alpine AS node_build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --link package.json package-lock.json ./
|
COPY --link package.json package-lock.json ./
|
||||||
COPY --from=composer_deps /app/vendor/symfony/ux-live-component/assets ./vendor/symfony/ux-live-component/assets
|
|
||||||
COPY --from=composer_deps /app/vendor/symfony/ux-react/assets ./vendor/symfony/ux-react/assets
|
|
||||||
COPY --from=composer_deps /app/vendor/symfony/ux-turbo/assets ./vendor/symfony/ux-turbo/assets
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY --link assets ./assets
|
COPY --link assets ./assets
|
||||||
COPY --link webpack.config.js ./
|
COPY --link webpack.config.js ./
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
chapterId: chapter.id
|
chapterId: chapter.id
|
||||||
}
|
}
|
||||||
}">
|
}">
|
||||||
<template v-if="chapter.isVolumeGroup">
|
<template v-if="chapter.isVolumeGroup && chapter.volumeChapterCount > 1">
|
||||||
{{ chapter.volumeChapterCount > 1 ? 'Chapitres ' : 'Chapitre ' }}{{ chapter.volumeChaptersRange }}
|
Chapitres {{ chapter.volumeChaptersRange }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
||||||
</router-link>
|
</router-link>
|
||||||
<span v-else class="text-gray-500 dark:text-gray-400">
|
<span v-else class="text-gray-500 dark:text-gray-400">
|
||||||
<template v-if="chapter.isVolumeGroup">
|
<template v-if="chapter.isVolumeGroup && chapter.volumeChapterCount > 1">
|
||||||
{{ chapter.volumeChapterCount > 1 ? 'Chapitres ' : 'Chapitre ' }}{{ chapter.volumeChaptersRange }}
|
Chapitres {{ chapter.volumeChaptersRange }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -53,6 +53,13 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Vider le cache prod stale avant le démarrage des workers FrankenPHP.
|
||||||
|
# Sans ça, les workers chargent l'ancien cache du volume Docker et crashent
|
||||||
|
# en boucle si les classes du cache ne correspondent plus à la version déployée.
|
||||||
|
if [ "$APP_ENV" = "prod" ]; then
|
||||||
|
rm -rf var/cache/prod
|
||||||
|
fi
|
||||||
|
|
||||||
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
||||||
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
worker {
|
worker {
|
||||||
file ./public/index.php
|
file ./public/index.php
|
||||||
|
num 2
|
||||||
}
|
}
|
||||||
|
|||||||
36
src/Command/RunMonitoringCommand.php
Normal file
36
src/Command/RunMonitoringCommand.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Command;
|
||||||
|
|
||||||
|
use App\Domain\Manga\Application\Command\CheckMonitoredMangas;
|
||||||
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Symfony\Component\Messenger\MessageBusInterface;
|
||||||
|
|
||||||
|
#[AsCommand(
|
||||||
|
name: 'app:monitoring:run',
|
||||||
|
description: 'Déclenche immédiatement la vérification des mangas monitorés (sans attendre le scheduler)',
|
||||||
|
)]
|
||||||
|
class RunMonitoringCommand extends Command
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private readonly MessageBusInterface $commandBus,
|
||||||
|
) {
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
|
{
|
||||||
|
$output->writeln('Déclenchement du monitoring des mangas...');
|
||||||
|
|
||||||
|
$this->commandBus->dispatch(new CheckMonitoredMangas());
|
||||||
|
|
||||||
|
$output->writeln('<info>Vérification lancée. Les nouveaux chapitres détectés seront scrappés via le worker commands.</info>');
|
||||||
|
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domain\Manga\Infrastructure\CommandHandler;
|
||||||
|
|
||||||
|
use App\Domain\Manga\Application\Command\CheckMonitoredMangas;
|
||||||
|
use App\Domain\Manga\Application\CommandHandler\CheckMonitoredMangasHandler;
|
||||||
|
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
|
||||||
|
|
||||||
|
#[AsMessageHandler]
|
||||||
|
readonly class SymfonyCheckMonitoredMangasHandler
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private CheckMonitoredMangasHandler $handler,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(CheckMonitoredMangas $command): void
|
||||||
|
{
|
||||||
|
$this->handler->handle($command);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user