Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beside using single php files, this lib need to have sqlite or mysql entegration #238

Open
kaerer opened this issue Jun 27, 2019 · 7 comments

Comments

@kaerer
Copy link

kaerer commented Jun 27, 2019

I am searching these kind of libs to implement into a symfony project.
I like the most this lib comparing to others, it is simple and easy to use but when i define the rule, it should save into a list (like sqlite, mysql or even into a single file) so it will be more controllable by programmatically. Generating task files dynamically may create issues and also not convenient for large projects.

@fluchi
Copy link

fluchi commented Jul 1, 2019

Hi @kaerer ,

I see your point about storing rules.
If I got it right, I've done it saving on both a yaml file and database.

I've used a yaml file to storage the system rules and from the database I got info about when something must run.
In other words, I generate and return a task on the fly, then it'll run on the appropriate time based on my db rules.

Hope that makes sense for you.

cheers

@PabloKowalczyk
Copy link
Collaborator

Hello guys,
@kaerer if i understand correctly, would you like to change tasks' "backend" from files to SQL database?

@judodan
Copy link

judodan commented Nov 23, 2020

I'd like to second this. I want to be able to set rules programmatically. I'd also like to be able to show the last time a task was run (I can do that by checking the log file) as well programmatically forcing a job to run. I suppose I could circumvent this all using "when" ?

@fluchi I'd be interested in seeing how you've done this.

@fluchi
Copy link

fluchi commented Nov 25, 2020

Hi @judodan ,

on my case, I have a set of rules on a database that tells me "when" to run a command, something like "run foobar after noon". Based on these set of rules, I check what should be running and inject commands on run's argument and create a tasks as described here. This verifications are done in a task file.

Basically, it is main schedule triggers every tasks and Tasks checking is something should run or not.

Hope that helps.

@pixobit
Copy link

pixobit commented Apr 28, 2021

I believe this is redundant, because this is completely possible at the moment, just as @fluchi pointed out the solution.

As for logging when something ran, you just need to write your own logger, which is also possible

@oularrea
Copy link

oularrea commented Sep 29, 2021

Hi guys, I want to use this library to generate multiple commands, but these commands will depend on a query to the DB. Do you know how I can inject symfony doctrine from a task file?

I am trying to do something like this, but instead of an http client do it with the query directly:
Reference

@PabloKowalczyk
Copy link
Collaborator

Hello @oularrea
First, create Symfony CLI command and write all your logic here, you will have access to everything in your app, then just use Crunz to run your Symfony's commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants