Fix scope var
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
ee19ea2993
commit
838b8a5382
|
@ -19,6 +19,7 @@ module.exports = Self => {
|
|||
Self.download = async() => {
|
||||
const models = Self.app.models;
|
||||
|
||||
let filePath;
|
||||
try {
|
||||
const imageQueue = await Self.find({
|
||||
where: {
|
||||
|
@ -35,7 +36,7 @@ module.exports = Self => {
|
|||
|
||||
for (let image of imageQueue) {
|
||||
const fileName = `${image.itemFk}.png`;
|
||||
const filePath = path.join(tempPath, fileName);
|
||||
filePath = path.join(tempPath, fileName);
|
||||
|
||||
https.get(image.url, async response => {
|
||||
// Upload file to temporary path
|
||||
|
@ -46,11 +47,11 @@ module.exports = Self => {
|
|||
// await image.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
return imageQueue;
|
||||
} catch (e) {
|
||||
fs.unlink(filePath);
|
||||
throw e;
|
||||
}
|
||||
|
||||
return imageQueue;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue