GithubHelp home page GithubHelp logo

ebbe / arask Goto Github PK

View Code? Open in Web Editor NEW
44.0 4.0 7.0 140 KB

Automatic RAils taSKs.

License: MIT License

Ruby 82.17% JavaScript 2.82% CSS 1.75% HTML 13.26%
ruby ruby-on-rails ruby-gem cron-syntax cron rails

arask's People

Contributors

dependabot[bot] avatar ebbe 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arask's Issues

3.minutes not running rake tasks

interval = interval.to_s.to_i

this is probably not allowing interval: 3.minutes to work.
and following is not creating any task in db.

arask.create task: "ticker:complete_my_task", interval: 3.minutes

edit: seems like it works on local. but on AWS ECS it never puts a record in db.

undefined method `server' for Arask::Railtie:Class (NoMethodError)

In the latest version 1.2.4, after running bundle install and restart the server, I am getting the below errors. After downgrading the version errors get resolved.

gems/railties-5.2.5/lib/rails/railtie.rb:192:in method_missing': undefined method server' for Arask::Railtie:Class (NoMethodError)

Rake Task only runs the first time

I am trying to use arask to run a simple recurring rake task and it runs the first time but silently fails after that.

I have reproduced the issue in my repo in a branch called arask-test
https://github.com/travisdock/sum/tree/arask-test

The test branch contains a task (lib/tasks/test.rake) that runs every minute. In the output below you can see that it runs the first time (Even though the arask output says 0 runs there is a 'puts' method that you can see prints "You did it"), but after that first run it never prints again even though arask jobs are enqueued and performed.

If you would like to run the project to see for yourself it is fully dockerized and you should be able to run it with just docker compose up

sum-web-1       | * Listening on http://0.0.0.0:3000
sum-web-1       | Use Ctrl-C to stop
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc] Performing Arask::RunJobs (Job ID: c2db8cfb-4714-4a57-b916-9986e3764ffc) from Async(default) enqueued at 2023-03-11T14:11:06Z
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc]   TRANSACTION (0.2ms)  BEGIN
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc]   Arask::AraskJob Load (0.7ms)  SELECT "arask_jobs".* FROM "arask_jobs" WHERE (execute_at < '2023-03-11 14:12:00.130862') FOR UPDATE
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc]   Arask::AraskJob Update (0.5ms)  UPDATE "arask_jobs" SET "execute_at" = $1, "updated_at" = $2 WHERE "arask_jobs"."id" = $3  [["execute_at", "2023-03-11 14:13:00"], ["updated_at", "2023-03-11 14:12:00.138032"], ["id", 4]]
sum-web-1       | Run options: --seed 30915
sum-web-1       | 
sum-web-1       | # Running:
sum-web-1       | 
sum-web-1       | 
sum-web-1       | 
sum-web-1       | Finished in 0.000800s, 0.0000 runs/s, 0.0000 assertions/s.
sum-web-1       | 0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
sum-web-1       | You did it
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc] Running daily recurring entries
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc]   TRANSACTION (0.8ms)  COMMIT
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc]   Arask::AraskJob Load (0.3ms)  SELECT "arask_jobs".* FROM "arask_jobs" ORDER BY "arask_jobs"."execute_at" ASC LIMIT $1  [["LIMIT", 1]]
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc] Enqueued Arask::RunJobs (Job ID: 179c6e14-f902-4af5-84bf-11d9ccce0055) to Async(default) at 2023-03-11 14:13:00 UTC
sum-web-1       | [ActiveJob] [Arask::RunJobs] [c2db8cfb-4714-4a57-b916-9986e3764ffc] Performed Arask::RunJobs (Job ID: c2db8cfb-4714-4a57-b916-9986e3764ffc) from Async(default) in 4143.04ms
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055] Performing Arask::RunJobs (Job ID: 179c6e14-f902-4af5-84bf-11d9ccce0055) from Async(default) enqueued at 2023-03-11T14:12:04Z
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055]   TRANSACTION (0.2ms)  BEGIN
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055]   Arask::AraskJob Load (0.4ms)  SELECT "arask_jobs".* FROM "arask_jobs" WHERE (execute_at < '2023-03-11 14:13:00.088752') FOR UPDATE
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055]   Arask::AraskJob Update (0.4ms)  UPDATE "arask_jobs" SET "execute_at" = $1, "updated_at" = $2 WHERE "arask_jobs"."id" = $3  [["execute_at", "2023-03-11 14:14:00"], ["updated_at", "2023-03-11 14:13:00.094966"], ["id", 4]]
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055]   TRANSACTION (1.1ms)  COMMIT
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055]   Arask::AraskJob Load (0.3ms)  SELECT "arask_jobs".* FROM "arask_jobs" ORDER BY "arask_jobs"."execute_at" ASC LIMIT $1  [["LIMIT", 1]]
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055] Enqueued Arask::RunJobs (Job ID: d7377188-436b-410c-b24e-5b243e53fa7c) to Async(default) at 2023-03-11 14:14:00 UTC
sum-web-1       | [ActiveJob] [Arask::RunJobs] [179c6e14-f902-4af5-84bf-11d9ccce0055] Performed Arask::RunJobs (Job ID: 179c6e14-f902-4af5-84bf-11d9ccce0055) from Async(default) in 963.99ms at 2023-03-11 14:15:00 UTC

Support Rails 6

Hi,
first of all, thank you for your work with arask. I use it in a small Rails project and it works great!

I tried to upgrade my project to Rails 6, but when I tried to install the new gems I got an error that arask has a dependency on Rails 5. I changed the dependencies within the gemspec file and did a short test run within my application where everything worked fine with arask.

Would you consider changing the gemspec file to accept Rails ">= 5.0.0"?

Arask makes Rails touch the database on asset:precompile for production

Ok, so I have the following issue:

When running

RAILS_ENV=production rake assets:precompile

normally Rails does not touch the database. This is important for example in docker, when the db is not yet set up in the building process. So using your gem breaks the typical docker building process.

However, using your gem it started to connect to the database (or at least go through the database.yml file which it doesnt do otherwise). This could also be because of some of your dependencies (however it seems you are not using any).

Do you have any ideas about this?

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.