{
}
/**
<<<<<<< HEAD
* Remove the metadata about a worker
*
* @param workerName The worker name to remove
*/
public void removeWorker(final String workerName) {
PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork()
{
public Void doWork(final Jedis jedis)
throws Exception
{
jedis.srem(key(WORKERS), workerName);
jedis.del(
key(WORKER, workerName),
key(WORKER, workerName, STARTED),
key(STAT, FAILED, workerName),
key(STAT, PROCESSED, workerName));
return null;
}
});
=======
* Keep trying to parse the date using all known formats
*
* @param dateStr the string to be parsed
* @return the parsed date
* @throws ParseException if the date format is unknown
*/
private static Date parseDate(final String dateStr)
throws ParseException
{
Date date = null;
try
{
date = ResqueDateFormatThreadLocal.getInstance().parse(dateStr);
}
catch (ParseException pe){}
if (date == null)
try
{
date = new SimpleDateFormat(DATE_FORMAT_RUBY).parse(dateStr);
}
catch (ParseException pe){}
}
if (date == null)
{
try
{
date = new SimpleDateFormat(DATE_FORMAT_PHP).parse(dateStr);
}
catch (ParseException pe){}
}
if (date == null)
{
throw new ParseException("Unparseable date: \"" + dateStr + "\"" , 0);
}
return date;
>>>>>>> 909236c7a4a7aa15f9b332a2fa51bcc000c9b648
}
} |