Code Monkey home page Code Monkey logo

Comments (6)

tf avatar tf commented on June 14, 2024

You need to run resque worker and scheduler rake tasks. Since the latest commit the generator also creates them for you. Without resque workers the file processing jobs are not run and the editor keeps on polling for the files to be ready.

from pageflow.

digitalkram avatar digitalkram commented on June 14, 2024

HI tf! Thanks for your reply. I did a "installation" from scratch. Hoping that the new generator will do the worker task generation and scheduling. To no avail. It is showing he same behaviour afterwards.
In the installation instructions it says about dependencies:
Redis server (for Resque)

I had no redis server before so I installed it. During configuration of pageflow I was wondering that there is no section about configuring a redis<=>pageflow "connection". Some ports to configure or something? Is there some documentation about that part somewhere. Could this relate to the current situation?

EDIT:
config/routes.rb => localhost:6379
/etc/redis.conf => port 6379, bind 127.0.0.1

So that is a fit. Can I check for reque workes and a schedule somehow?
EDIT2: I placed the lib/tasks/resque.rake file with the content of your latest commit. It is still not working probably because resque/tasks and resque_scheduler/tasks do not exist?

from pageflow.

tf avatar tf commented on June 14, 2024

The latest commit is not part of any gem yet. I'll release a new version early next week.

I am not really sure what you mean by "config/routes.rb => localhost:6379". Still, 6379 is the default Redis port. So everything should be fine. What output do you see when you run bundle exec rake resque:work? Are resque jobs listed when your run bundle exec rake -T?

from pageflow.

digitalkram avatar digitalkram commented on June 14, 2024

HI tf, just wanted to confirm that I crosschecked that redis.conf and routes.rb are both referring to the same port, so that everything is fine in this respect. As there was no configuration step for redis I was wondering if this might be part of the problem in case my distribution is using a non-standard port or something. But as you said it is just fine. :)

root@hostname [/mnt/data/playground]# bundle exec rake resque:work
set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work
root@hostname [/mnt/data/playground]# QUEUE=critical,high bundle exec rake resque:work

No output at all., Simply runs/works. Not the most verbose guy around. :D

bundle exec rake -T

Outputs some kind of usage information/tasks:

rake about                              # List versions of all Rails frameworks and the environment
rake assets:clean[keep]                 # Remove old compiled assets
rake assets:clobber                     # Remove compiled assets
rake assets:environment                 # Load asset compile environment
rake assets:precompile                  # Compile all the assets named in config.assets.precompile
rake bourbon:install[sass_path]         # Move files to the Rails assets directory
rake cache_digests:dependencies         # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake cache_digests:nested_dependencies  # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake db:create                          # Create the database from DATABASE_URL or config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)
rake db:drop                            # Drops the database using DATABASE_URL or the current Rails.env (use db:drop:all to drop all databases)
rake db:fixtures:load                   # Load fixtures into the current environment's database
rake db:migrate                         # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
rake db:migrate:status                  # Display status of migrations
rake db:rollback                        # Rolls the schema back to the previous version (specify steps w/ STEP=n)
rake db:schema:cache:clear              # Clear a db/schema_cache.dump file
rake db:schema:cache:dump               # Create a db/schema_cache.dump file
rake db:schema:dump                     # Create a db/schema.rb file that can be portably used against any DB supported by AR
rake db:schema:load                     # Load a schema.rb file into the database
rake db:seed                            # Load the seed data from db/seeds.rb
rake db:setup                           # Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the db first)
rake db:structure:dump                  # Dump the database structure to db/structure.sql
rake db:version                         # Retrieves the current schema version number
rake i18n:js:export                     # Export the messages files
rake i18n:js:setup                      # Copy i18n.js and configuration file
rake i18n:js:update                     # Update the JavaScript library
rake log:clear                          # Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)
rake middleware                         # Prints out your Rack middleware stack
rake notes                              # Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)
rake notes:custom                       # Enumerate a custom annotation, specify with ANNOTATION=CUSTOM
rake pageflow:install:migrations        # Copy migrations from pageflow to application
rake paperclip:clean                    # Cleans out invalid attachments
rake paperclip:refresh                  # Refreshes both metadata and thumbnails
rake paperclip:refresh:metadata         # Regenerates content_type/size metadata for a given CLASS (and optional ATTACHMENT)
rake paperclip:refresh:missing_styles   # Regenerates missing thumbnail styles for all classes using Paperclip
rake paperclip:refresh:thumbnails       # Regenerates thumbnails for a given CLASS (and optional ATTACHMENT and STYLES splitted by comma)
rake rails:template                     # Applies the template supplied by LOCATION=(/path/to/template) or URL
rake rails:update                       # Update configs and some other initially generated files (or use just update:configs, update:bin, or update:application_controller)
rake resque:failures:sort               # Sort the 'failed' queue for the redis_multi_queue failure backend
rake resque:scheduler                   # Start Resque Scheduler
rake resque:work                        # Start a Resque worker
rake resque:workers                     # Start multiple Resque workers
rake routes                             # Print out all defined routes in match order, with names
rake secret                             # Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions)
rake state_machine:draw                 # Draws state machines using GraphViz (options: CLASS=User,Vehicle; FILE=user.rb,vehicle.rb [not required in Rails / Merb]; FONT=Arial; FORMAT=png; ORIENTATION=portrait; HUMAN_NAMES=true
rake stats                              # Report code statistics (KLOCs, etc) from the application
rake test                               # Runs test:units, test:functionals, test:integration together
rake test:all                           # Run tests quickly by merging all types and not resetting db
rake test:all:db                        # Run tests quickly, but also reset db
rake test:recent                        # Run tests for {:recent=>["test:deprecated", "test:prepare"]} / Deprecated; Test recent changes
rake test:uncommitted                   # Run tests for {:uncommitted=>["test:deprecated", "test:prepare"]} / Deprecated; Test changes since last checkin (only Subversion and Git)
rake time:zones:all                     # Displays all time zones, also available: time:zones:us, time:zones:local -- filter with OFFSET parameter, e.g., OFFSET=-6
rake tmp:clear                          # Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear)
rake tmp:create                         # Creates tmp directories for sessions, cache, sockets, and pids

Based on your latest commit I placed the following content in lib/tasks/resque.rake:

require 'resque/tasks'
require 'resque_scheduler/tasks'

namespace :resque do
  # Tell resque to initialize the rails app in worker processes
  task :setup => :environment
end

But for this to work there is probably a bit more required (literally)? ;) there is no resque/task folder/file anywhere for example.

If you do not have the time to line out what needs to be done manually to create and schedule workers I can also wait for your gem next week and let the generator do the dirty job for me. Thanks for your help so far!

Cheers

P.S.:
Schedule is empty?

root@hostname [/mnt/data/playground]# rake resque:scheduler
resque-scheduler: [INFO] 2014-05-10T10:20:18+02:00: Loading Schedule
resque-scheduler: [INFO] 2014-05-10T10:20:18+02:00: Schedule empty! Set {
resque-scheduler: [INFO] 2014-05-10T10:20:18+02:00: Schedules Loaded

Ctrl+C

root@hostname [/mnt/data/playground]# find . -type f -exec grep -il Resque.schedule {} \;
./lib/tasks/resque.rake
./Gemfile.lock
root@hostname [/mnt/data/playground]# 

from pageflow.

tf avatar tf commented on June 14, 2024

That looks quite good already. The two require statements reference tasks files from the resque and resque_scheduler gem, respectively.

You need to pass a QUEUE parameter to rake resque:work to define which queues the worker is supposed to pull jobs from. If you just have one worker, you can tell it to handle all queues by passing *.

QUEUE=* bundle exec rake resque:work

This does not generate any output - or at most stacktraces if something is broken ;) But processed jobs generate log output in log/jobs/development/<name_of_queue>.log.

The way you run the scheduler is correct. The schedule is indeed empty since we only schedule jobs dynamically. So this is fine.

Again regarding redis setup: I'm a little worried about your routes.rb file since I'm not aware of any reference to redis or a redis port that could be in there. The only place to tell resque at which port to expect the redis server is in config/initializers/resque.rb. routes.rb is normally only concerned with urls provided by app.

On a more general note: I realize that at least some of the above should be integrated into the README/wiki. But I am still trying to figure out where to draw the line since many aspects - while required to get Pageflow to work - are not really Pageflow concepts but rather concern configuration of the libraries Pageflow depends on. We should probably add more links to related documentation of those projects.

from pageflow.

digitalkram avatar digitalkram commented on June 14, 2024

Thanks tf! It is working now! :)

Yes, referencing relevant documentation of pageflow dependencies is a probably a good idea.

Cheers,

from pageflow.

Related Issues (20)

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.