What happens if Drupal triggers a crawl job when one is already running?

CommentFileSizeAuthor
#6 runbot.patch487 bytesrobertdouglass

Comments

dstuart’s picture

Component: Documentation » Code
Assigned: Unassigned » dstuart
Category: support » bug

In short yes, ill look at adding a lock file into runbot and update nutch to do a check before run

dstuart’s picture

Status: Active » Needs review

Right have added basic semaphore functionality into the runbot that will add a lock file when the script it kicked off and rm it at it completion. It will check for said lock file and exit with 0 if it found.

Should be in dev version now

karljohann’s picture

1) When the semaphore is in on mode the debug doesn't run.

2) What process should I look for when Nutch is running? I get the "process is already running" message but I can't find the process.

dstuart’s picture

Right looks like it needs a little more work. Basically I added a lock from to the script (found under /tmp/nutch.lock) . it should create the lock file at the start of the runbot script then delete it at the end. Ill have a play but you can just delete that file or comment out this bit of code in the runbot script

NAME="nutch"
LOCK="/tmp/${NAME}.lock"
if [ -f "$LOCK" ]
 then
  echo "Process already running..."
  exit 0
else
  echo "create lock"
  echo $$ >> "$LOCK"
fi
karljohann’s picture

Okay thanks, that works fine

robertdouglass’s picture

Status: Needs review » Fixed
StatusFileSize
new487 bytes

Here's the patch. Marking as fixed since it's committed.

dstuart’s picture

Status: Fixed » Closed (fixed)