Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

timeout error checking

 [1/3] from: jblake::arsenaldigital::com at: 13-Mar-2007 16:07


I have a script that goes thru a list of ips and logs into the postgres db on those ip's to run a query. It runs well when th eip's are all up. I have to admit I didn't add error checking to deal with if the device doesn't respond. Currently, the script exits and doesn't try the rest of the IP's. Do any of yall have a quick way of dealing with something like this? I'm using; utilip: read/lines %/<filenamehere> foreach ip utilip [ result: read join pgsql: <query here> if find result "false"[ write %<errorfilehere> Do I need to another "if find result" but have the timeout response in there? ..reading the Rebol book and "Rebol for Dummies" for info.................. Thanks John

 [2/3] from: tom:conlin:gma:il at: 13-Mar-2007 14:12


On 3/13/07, John Blake <jblake-arsenaldigital.com> wrote:
> I have a script that goes thru a list of ips and logs into the postgres > db on those ip's to run a query.
<<quoted lines omitted: 17>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
compleatly untested in anyway (including spell checking) but should give hints for new words to look up utilip: read/lines %/<filenamehere> foreach ip utilip [ if error? err: try [read join pgsql: <query here>][ write %<errorfilehere> probe disarm err ] ] -- ... nice weather eh

 [3/3] from: jblake:arsenaldigital at: 14-Mar-2007 9:58


Thanks I went with this; foreach ip utilip [ if error? err: try < initial test queryinfo> ] [ err: disarm err either err/id = 'no-connect' [ ] [ result: read join pgsql:<actual queryinfo> The results of the query will either be "true" or "false". Granted, it could connect to the dbase twice if everythings ok. I couldn't figure out how to use 1 query and then test to see if it timed out or test the results. Thanks for the help John

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted