mirror of https://github.com/apache/nifi.git
NIFI-526 move check into try so writeLock is released
Signed-off-by: Mark Payne <markap14@hotmail.com>
This commit is contained in:
parent
6e492b4082
commit
b7d2154f7d
|
@ -434,8 +434,8 @@ public class GetHTTP extends AbstractSessionFactoryProcessor {
|
||||||
if (timeToPersist < System.currentTimeMillis()) {
|
if (timeToPersist < System.currentTimeMillis()) {
|
||||||
readLock.unlock();
|
readLock.unlock();
|
||||||
writeLock.lock();
|
writeLock.lock();
|
||||||
if (timeToPersist < System.currentTimeMillis()) {
|
try {
|
||||||
try {
|
if (timeToPersist < System.currentTimeMillis()) {
|
||||||
timeToPersist = System.currentTimeMillis() + PERSISTENCE_INTERVAL_MSEC;
|
timeToPersist = System.currentTimeMillis() + PERSISTENCE_INTERVAL_MSEC;
|
||||||
File httpCache = new File(HTTP_CACHE_FILE_PREFIX + getIdentifier());
|
File httpCache = new File(HTTP_CACHE_FILE_PREFIX + getIdentifier());
|
||||||
try (FileOutputStream fos = new FileOutputStream(httpCache)) {
|
try (FileOutputStream fos = new FileOutputStream(httpCache)) {
|
||||||
|
@ -446,10 +446,11 @@ public class GetHTTP extends AbstractSessionFactoryProcessor {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getLogger().error("Failed to persist ETag and LastMod due to " + e, e);
|
getLogger().error("Failed to persist ETag and LastMod due to " + e, e);
|
||||||
}
|
}
|
||||||
} finally {
|
}
|
||||||
readLock.lock();
|
}
|
||||||
writeLock.unlock();
|
finally {
|
||||||
}
|
readLock.lock();
|
||||||
|
writeLock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue