Fix a dangling neo4j session
This commit is contained in:
parent
d72a65be53
commit
7bc29c3ec7
|
@ -69,6 +69,8 @@ export default async function processImage({ driver, markFinishedImage }, id) {
|
|||
if (urlResult.records.length == 2) {
|
||||
markFinishedImage()
|
||||
|
||||
session.close()
|
||||
|
||||
console.log('Skipping image', photo.path)
|
||||
return
|
||||
}
|
||||
|
@ -80,8 +82,12 @@ export default async function processImage({ driver, markFinishedImage }, id) {
|
|||
{ id }
|
||||
)
|
||||
|
||||
try {
|
||||
await fs.remove(imagePath)
|
||||
await fs.mkdirp(imagePath)
|
||||
} catch (e) {
|
||||
console.error('Could not remove old image, and make directory', e, e.stack)
|
||||
}
|
||||
|
||||
let originalPath = photo.path
|
||||
|
||||
|
|
|
@ -145,7 +145,11 @@ export default async function scanUser({ driver, scanAlbum }, user) {
|
|||
)
|
||||
|
||||
for (const albumId of deletedAlbumIds) {
|
||||
try {
|
||||
await fs.remove(getAlbumCachePath(albumId))
|
||||
} catch (e) {
|
||||
console.error('Error while trying to delete album from cache', e, e.stack)
|
||||
}
|
||||
}
|
||||
|
||||
console.log(
|
||||
|
|
Loading…
Reference in New Issue