PDA

View Full Version : Anyone have issues with running?() lately?



Alorn15
12-15-2010, 10:45 PM
When I first started working with azbounty I noticed that running? would occasionally (every day or two) return an erroneous value when it was called in a bigshot object created in azbounty.lic. The situation was in bigshot's start_script(), where a script is kicked off and then bigshot sleeps until running? returns false. Well, the script wouldn't get kicked off, because it was already considered to be running, and this would cause azbounty to hang indefinitely as it waited for a script to stop running which wasn't actually running in the first place.

I solved this problem by introducing a hack into bigshot, where start_script() will kill a script if it is already running.

However, now I'm running into the same issue when running? is called natively in azbounty. Again, only every couple days. Anyone else run into this kind of weirdness?

Tillmen will probably jump in and explain what I'm doing that's dumb.

SpiffyJr
12-15-2010, 11:13 PM
I had to write my own script_running? method because running? will match partials.

Someone had hunt scripts like aimer, aimer2, aimer3 and when I tried to kill them I'd wait for it to exit. Well, aimer would exit but running?('aimer') returned true for aimer2 and aimer3 so it hung indefinitely.

Blushy
12-16-2010, 10:45 AM
I had to write my own script_running? method because running? will match partials.

Someone had hunt scripts like aimer, aimer2, aimer3 and when I tried to kill them I'd wait for it to exit. Well, aimer would exit but running?('aimer') returned true for aimer2 and aimer3 so it hung indefinitely.
Also, you can just pass it a regular expression:

running?(/aimer$/)

will do the trick.

SpiffyJr
12-16-2010, 10:56 AM
Also, you can just pass it a regular expression:

running?(/aimer$/)

will do the trick.

You didn't used to be able to!

Blushy
12-16-2010, 11:32 AM
You didn't used to be able to!
I don't know how it used to work, but it more or less just pattern matches (=~) its argument with all the running script names inserted via #{} into a regular expression. So now you can!

SpiffyJr
12-16-2010, 12:22 PM
I don't know how it used to work, but it more or less just pattern matches (=~) its argument with all the running script names inserted via #{} into a regular expression. So now you can!

Can not! My accounts are canceled. Why do you keep lying to me?

Gibreficul
12-16-2010, 02:45 PM
Can not! My accounts are canceled. Why do you keep lying to me?

That's too bad. You'll be missed.

Tordane
12-16-2010, 02:50 PM
That's too bad. You'll be missed.

The Spiffster always returns.