You can start it from the environment.rb, yes, but you need to remove
the semaphore file before starting he mongrels.
This cannot be done from within the environment.rb because each
mongrel starts its own process.
I want to have the scheduler inside my Rails application.
I could run it using script/runner but then I have to maintain another
process.
This way the scheduler is stopped when I stop the application and vice-
versa.
On Jul 26, 3:55 pm, "Lee Fyock" <[EMAIL PROTECTED]> wrote:
> You could run it from environment.rb, though, since your semaphore file
> takes care of multiple app instances running the scheduler. That's the whole
> point, right? :-)
> I'm not very familiar with capistrano. Is it responsible for launching your
> application as well? If so, couldn't you skip the whole semaphore thing and
> have capistrano start and stop the scheduler, rather than an application
> instance starting the scheduler?
>
> Thanks,
> Lee
>
> On 7/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > no, not from environment.rb.
> > That would give the same problem, because this also gets run multiple
> > times.
> > I use capistrano to update my app, and I made an hook that removes
> > this file when the application gets updated and before it restarts.
>
> > # part of my capistrano2 config-file
> > ###############################################
> > desc "Run this before the restart"
> > before "deploy:restart", :remove_semaphore
>
> > desc "Removing semaphore file to start the scheduler"
> > task :remove_semaphore do
> > semaphore = "#{ release_path }/tmp/scheduler"
> > sudo "rm -f #{semaphore}"
> > end
> > ###############################################
>
> > On Jul 26, 2:45 pm, "Lee Fyock" <[EMAIL PROTECTED]> wrote:
> > > How do you know when to delete the semaphore file, so that you can shut
> > down
> > > the server, start it up, and have the scheduler run again?
> > > Where did you place this code? In environment.rb (or a file that gets
> > called
> > > from environment.rb)?
>
> > > Thanks,
> > > Lee
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenWFEru users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---