mirror of
https://github.com/sim1222/misskey.git
synced 2025-07-09 20:30:02 +09:00
refactor: use date-fns
This commit is contained in:
@ -4,7 +4,7 @@ import * as fs from 'fs';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import { addFile } from '@/services/drive/add-file';
|
||||
import * as dateFormat from 'dateformat';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { getFullApAccount } from '@/misc/convert-host';
|
||||
import { Users, Blockings } from '@/models/index';
|
||||
import { MoreThan } from 'typeorm';
|
||||
@ -85,7 +85,7 @@ export async function exportBlocking(job: Bull.Job<DbUserJobData>, done: any): P
|
||||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'blocking-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const fileName = 'blocking-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.csv';
|
||||
const driveFile = await addFile({ user, path, name: fileName, force: true });
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
@ -7,7 +7,7 @@ const mime = require('mime-types');
|
||||
const archiver = require('archiver');
|
||||
import { queueLogger } from '../../logger';
|
||||
import { addFile } from '@/services/drive/add-file';
|
||||
import * as dateFormat from 'dateformat';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { Users, Emojis } from '@/models/index';
|
||||
import { } from '@/queue/types';
|
||||
import { downloadUrl } from '@/misc/download-url';
|
||||
@ -110,7 +110,7 @@ export async function exportCustomEmojis(job: Bull.Job, done: () => void): Promi
|
||||
archiveStream.on('close', async () => {
|
||||
logger.succ(`Exported to: ${archivePath}`);
|
||||
|
||||
const fileName = 'custom-emojis-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.zip';
|
||||
const fileName = 'custom-emojis-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.zip';
|
||||
const driveFile = await addFile({ user, path: archivePath, name: fileName, force: true });
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
@ -4,7 +4,7 @@ import * as fs from 'fs';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import { addFile } from '@/services/drive/add-file';
|
||||
import * as dateFormat from 'dateformat';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { getFullApAccount } from '@/misc/convert-host';
|
||||
import { Users, Followings, Mutings } from '@/models/index';
|
||||
import { In, MoreThan, Not } from 'typeorm';
|
||||
@ -86,7 +86,7 @@ export async function exportFollowing(job: Bull.Job<DbUserJobData>, done: () =>
|
||||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'following-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const fileName = 'following-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.csv';
|
||||
const driveFile = await addFile({ user, path, name: fileName, force: true });
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
@ -4,7 +4,7 @@ import * as fs from 'fs';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import { addFile } from '@/services/drive/add-file';
|
||||
import * as dateFormat from 'dateformat';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { getFullApAccount } from '@/misc/convert-host';
|
||||
import { Users, Mutings } from '@/models/index';
|
||||
import { MoreThan } from 'typeorm';
|
||||
@ -85,7 +85,7 @@ export async function exportMute(job: Bull.Job<DbUserJobData>, done: any): Promi
|
||||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'mute-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const fileName = 'mute-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.csv';
|
||||
const driveFile = await addFile({ user, path, name: fileName, force: true });
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
@ -4,7 +4,7 @@ import * as fs from 'fs';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import { addFile } from '@/services/drive/add-file';
|
||||
import * as dateFormat from 'dateformat';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { Users, Notes, Polls } from '@/models/index';
|
||||
import { MoreThan } from 'typeorm';
|
||||
import { Note } from '@/models/entities/note';
|
||||
@ -94,7 +94,7 @@ export async function exportNotes(job: Bull.Job<DbUserJobData>, done: any): Prom
|
||||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'notes-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.json';
|
||||
const fileName = 'notes-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.json';
|
||||
const driveFile = await addFile({ user, path, name: fileName, force: true });
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
@ -4,7 +4,7 @@ import * as fs from 'fs';
|
||||
|
||||
import { queueLogger } from '../../logger';
|
||||
import { addFile } from '@/services/drive/add-file';
|
||||
import * as dateFormat from 'dateformat';
|
||||
import { format as dateFormat } from 'date-fns';
|
||||
import { getFullApAccount } from '@/misc/convert-host';
|
||||
import { Users, UserLists, UserListJoinings } from '@/models/index';
|
||||
import { In } from 'typeorm';
|
||||
@ -62,7 +62,7 @@ export async function exportUserLists(job: Bull.Job<DbUserJobData>, done: any):
|
||||
stream.end();
|
||||
logger.succ(`Exported to: ${path}`);
|
||||
|
||||
const fileName = 'user-lists-' + dateFormat(new Date(), 'yyyy-mm-dd-HH-MM-ss') + '.csv';
|
||||
const fileName = 'user-lists-' + dateFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss') + '.csv';
|
||||
const driveFile = await addFile({ user, path, name: fileName, force: true });
|
||||
|
||||
logger.succ(`Exported to: ${driveFile.id}`);
|
||||
|
Reference in New Issue
Block a user