Ahh sorry, should describe this better... I said remote, but meant "ajax"
I've got a web app, that triggers a local capistrano task. I've cusomized the capistrano logger, so that in addition to writing to the console, I'm writing to a tmp file. As soon as the web app triggers the task, it starts firing off ajax requests to another script which then returns the content of the tmp log file. That way I get live feedback right in the browser. It actually works quite well! Currently, I have an exit event that writes 'COMPLETE' to the log file, when the ajax polling request sees that at the end of the file, it clears the file and then the polling stops. The problem is, sometimes it gets off, not sure why but things happen. So I'm just experimenting, trying to find the most reliable way to find out when the task is done, or has completely failed. Matt On Aug 2, 12:58 pm, "Jamis Buck" <[EMAIL PROTECTED]> wrote: > I'm confused...how is the Capistrano logger writing to a remote server? > > - Jamis > > On 8/2/07, goodieboy <[EMAIL PROTECTED]> wrote: > > > > > I see. I'm using a remote script to poll a temp log file created by > > the Capistrano logger and need a reliable way to know when it has > > stopped the task/command. Do you think if I just create even handlers > > that create and delete a file, that would work just as well? So if the > > file is there the command is still running, if it's not there then > > there isn't anything running? I'm worried about the case where a > > Capistrano task (or parent process) may die, and not call the exit > > event handler. Do you have any advice? :) > > > Matt > > > On Aug 2, 11:05 am, "Jamis Buck" <[EMAIL PROTECTED]> wrote: > > > Do you mean, the process id of Capistrano itself, or the process id of > > > the processes that Capistrano executes remotely? > > > > In the first case, the Ruby variable $$ will give you Capistrano's pid > > > on the machine you are running Capistrano, In the latter case, no, > > > Capistrano doesn't provide a means to grab the pid of an arbitrary > > > process. Most programs that are meant to be run as a daemon support an > > > option for writing the pid to a file, though. > > > > - Jamis > > > > On 8/2/07, goodieboy <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I'm wondering if there is a way to get the current Capistrano process > > > > id? I'm thinking about creating event handlers to create a pid file > > > > before any task, and remove the file on exit. It'd be nice to actually > > > > put the pid in there though. Is there a way to do this? > > > > > Thanks > > > > Matt --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
