Fixed uuid import. Changed fs rmdir to rm.

This commit is contained in:
DebaucheryLibrarian 2021-11-21 00:31:09 +01:00
parent e0908a5f5e
commit 98c103c625
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ const fs = require('fs');
const fsPromises = require('fs').promises;
const path = require('path');
const stream = require('stream');
const nanoid = require('nanoid/non-secure');
const { nanoid } = require('nanoid/non-secure');
const mime = require('mime');
// const fileType = require('file-type');
const ffmpeg = require('fluent-ffmpeg');
@ -948,7 +948,7 @@ async function flushOrphanedMedia() {
await deleteS3Objects(orphanedMedia.filter((media) => media.is_s3));
}
await fsPromises.rmdir(path.join(config.media.path, 'temp'), { recursive: true });
await fsPromises.rm(path.join(config.media.path, 'temp'), { recursive: true });
logger.info('Cleared temporary media directory');
}

View File

@ -4,7 +4,7 @@
const config = require('config');
const faker = require('faker');
const nanoid = require('nanoid');
const { nanoid } = require('nanoid');
const moment = require('moment');
const knex = require('../knex');

View File

@ -6,7 +6,7 @@ const fsPromises = require('fs').promises;
const Promise = require('bluebird');
const blake2 = require('blake2');
const sharp = require('sharp');
const nanoid = require('nanoid');
const { nanoid } = require('nanoid');
const { PassThrough } = require('stream');
const http = require('./http');

View File

@ -3,7 +3,7 @@
const config = require('config');
const AWS = require('aws-sdk');
const fs = require('fs');
const nanoid = require('nanoid');
const { nanoid } = require('nanoid');
async function init() {
const filepath = './public/img/sfw/animals/j0iiByCxGfA.jpeg';