Coder Social home page Coder Social logo

synolia / syliusschedulercommandplugin Goto Github PK

View Code? Open in Web Editor NEW
30.0 12.0 18.0 592 KB

Schedule Symfony Commands in your Sylius

License: MIT License

Gherkin 3.72% PHP 89.57% Twig 2.51% Makefile 2.19% JavaScript 1.64% CSS 0.37%
sylius-plugin sylius

syliusschedulercommandplugin's People

Contributors

galloisluca avatar hugfes avatar jibbarth avatar laiah avatar lruozzi9 avatar maxperei avatar oallain avatar reyostallenberg avatar thegrimmchester avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

syliusschedulercommandplugin's Issues

[Feature] Add 24 hours format option

Is your feature request related to a problem? Please describe.
The CronExpressionHumanizer do not use the 3rd argument of translate to allow 24 hours format to be used.

Describe the solution you'd like
Maybe use an option to pass true/false.

[Bug] No log file

Describe the bug
On the admin after an execution, no log file are shown.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '/admin/commands/'
  2. Setup a new task with 'execute now'
  3. No log file are shown in '/admin/scheduled-commands/'

Expected behavior
I want log file to be visible

Screenshots
image

[Feature] Timeout should be only a (signed) positive integer

Is your feature request related to a problem? Please describe.
The configurable timeout should be a positive integer only in the admin form.

Describe the solution you'd like
Add a Symfony constraint to disallow "-n" numbers.

Describe alternatives you've considered
N/A

Additional context
A customer I had with access admin to its shop has modified by mistake (mouse scroll on page scroll) the timeout and it was set to -3. Symony process crashed for days because the timeout value was invalid (obviously).

[Feature] Guide about doctrine naming_strategy

Is your feature request related to a problem? Please describe.
When I install the project, with the naming strategy doctrine.orm.naming_strategy.underscore the fields are not found due to other case being used than underscore.

Unknown column 's0_.cron_expression' in 'field list'

Describe the solution you'd like
I'm not sure what the fix should be but a note about this would be great.

[Feature] give possibility to run multiple instances on one server

Is your feature request related to a problem? Please describe.
I have two websites hosted on the same server. I can't run twho schedulers

Describe the solution you'd like
In this file vendor/synolia/sylius-scheduler-command-plugin/src/Command/SynoliaSchedulerRunCommand.php
replace
if (!$this->lock() {
by
if (!$this->lock(realpath(dirname(FILE)))) {

[Feature] Translate human readable cron expression

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I would realy love to see values in the human_readable_expression (Humanized expression) column also being translated.

Describe the solution you'd like
Use another library, like e.g. https://github.com/lorisleiva/cron-translator in ScheduledCommandHumanReadableExpressionType as that supports translations, I could make a PR for you to implement this and I could make a PR on that library so it also supports Dutch (nl).

Describe alternatives you've considered

Additional context

[Bug] Last command not found not persited

Describe the bug
If shceduled command not fount and run at last, error code is not saved on database.

To Reproduce
Steps to reproduce the behavior:

  1. Register new sheduled command
  2. Force to have non existant command (e.g: asset:installs)
  3. Run bin/console synolia:scheduler-run
  4. Check last return code

Expected behavior
The sheduled command should have -1 as last return code

Additional context
In the case on last command, there is no flush() instruction.

[Bug] "Live tail" not working due to missing js

Describe the bug
when I click on the log tail button, nothing happens. In console a .js script is missing. It seems related to the themes but there's no documentation about usage.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '/admin/scheduled-commands/'
  2. Click on 'See log in live'

Expected behavior
'Live view' of log file working.

Screenshots

GET http://www.foo.localhost/_themes/foo/bar/bundles/synoliasyliusschedulercommandplugin/column/index.js net::ERR_ABORTED 404

purge-history Command

Hi,

I would like to purge the history however when I try to run the symfony command I get this message as a response.

php bin/console synolia:scheduler:purge-history --all

**There are no commands defined in the "synolia:scheduler" namespace.

Did you mean this?
synolia**

Do I have to activate something in the configuration?
I'm on Sylius 1.10.7
Thanks

[Bug] Warning: Attempt to read property "namespaces" on null

Composer infos

sylius/calendar        v0.3.0  Date handling for PHP applications.
sylius/fixtures-bundle v1.7.0  Configurable fixtures for Symfony applications.
sylius/grid-bundle     v1.10.2 Amazing grids with support of filters and custom fields integrated into Symfony.
sylius/mailer-bundle   v1.6.0  Mailers and e-mail template management for Symfony projects.
sylius/paypal-plugin   v1.4.1  PayPal plugin for Sylius.
sylius/registry        v1.6.0  Services registry.
sylius/resource-bundle v1.8.4  Resource component for Sylius.
sylius/sylius          v1.11.4 E-Commerce platform for PHP, based on Symfony framework.
sylius/theme-bundle    v2.2.0  Themes management for Symfony projects.

synolia/sylius-scheduler-command-plugin v3.1.0 Scheduler Command Plugin.

Describe the bug
Try to click on "New"

To Reproduce
Steps to reproduce the behavior:

  1. click "Create"

Screenshots

ErrorException:
Warning: Attempt to read property "namespaces" on null
  at C:\wamp\www\sylius\Sylius-Standard\vendor\synolia\sylius-scheduler-command-plugin\src\Parser\CommandParser.php:63

image

Additional context
Add any other context about the problem here.

[Feature] Using the Symfony Scheduler

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
With the stable release of the Symfony Scheduler (exp. since 6.3) component right around the corner, we should keep into account that soon we will be able to use that to handle scheduling and handling of commands.

Therefore, it might be wise to already start thinking about this, when changing or adding current features to this project.
I think the Scheduler component will be able to remove a lot of code from this repo, and therefore would be the clear better choice in the future.

As a quick example, the logic used to check if a command should be scheduled to run, and when, can be condensed into this single line:

(new Schedule())->add(RecurringMessage::cron($command->getCronExpression(), new CommandMessage($command)));

If you would like any help on making this happen, let me know, and i'd love to help out with the transition

[Bug][Security] Read and partially write any file on the server

Currently, we are able to put ANY file on the server as "log file" with relative paths. That means, we can access

Steps to reproduce the behavior:

  1. Go to 'Scheduled Commands'
  2. Click on 'Edit'
  3. Type '../../.env' as Log file
  4. Click on 'Live view', 'Clear logs' or just download the result

Expected behavior
User can't perform read/write operations on files other than logs.

[Feature] Allow process timeout override per command

I have a long running command scheduled, which it itself runs a set of other console commands (runs a command for each channel and locale combination) and it regularly hits the 60 second time out and doesn't finish running.

I'm thinking it should be possible to pass a time out in seconds from the admin through to setTimeout() on the process, which can also take null to disable, however the Symfony docs say that for longer tasks you have to also check the timeout manually so not sure how practical that is. I also realise there might be issues if the timeout is longer than the interval between two runs of the command.

[Bug] 0 * * * * execute every minute

Describe the bug
I have set a task that would normally execute every hours: 0 * * * *

Except it runs every minutes if I look at the history of scheduled commands ?

To Reproduce
Setup a task 0 * * * * and go to admin/scheduled-commands/

Expected behavior
Run every hours at m + 0.

Screenshots
Capture d’écran de 2023-05-25 16-57-37
Capture d’écran de 2023-05-25 16-57-19

Additional context
N/A

Erreur with platform check

I'm trying to execute a cmd (sylius:import) but I get this error

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.29. PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.29. in /PATH_TO_PROJECT/vendor/composer/platform_check.php on line 24

I'm using a platform with several PHP installed but the default one is 8.2
When I'm launching the same command in the crontab, I haven't the error

The command :
php8.2 /PATH_TO_PROJECT/bin/console sylius:import custom_customers /ABSOLUTE_PATH/clients.csv --format=csv > /PATH_TO_PROJECT/var/log/cron/import_client.log

[Feature] Sylius 1.11 support

Is your feature request related to a problem? Please describe.
Hello, all in the title, do you plan to support Sylius 1.11 anytime soon ?

Create an index for the 'state' field of the 'synolia_scheduled_commands' table

I'm getting slow queries report from Mysql because of the lack of an index for the "state" field.

The query that is reported is the following:

SELECT t0.id AS id_1, t0.name AS name_2, t0.command AS command_3, t0.arguments AS arguments_4, t0.executed_at AS executed_at_5, t0.last_return_code AS last_return_code_6, t0.log_file AS log_file_7, t0.command_end_time AS command_end_time_8, t0.created_at AS created_at_9, t0.state AS state_10, t0.timeout AS timeout_11, t0.idle_timeout AS idle_timeout_12, t0.owner_id AS owner_id_13 FROM synolia_scheduled_commands t0 WHERE t0.state = 'waiting';

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.