1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

improved logging

This commit is contained in:
Patrik J. Braun 2018-05-23 21:53:53 -04:00
parent c08a2b35ba
commit a95cd837cd
2 changed files with 4 additions and 2 deletions

View File

@ -69,6 +69,7 @@ export class SharingMWs {
return next();
} catch (err) {
console.warn(err);
return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during creating sharing link', err));
}
}

View File

@ -4,12 +4,13 @@ import {SQLConnection} from './SQLConnection';
import {SharingEntity} from './enitites/SharingEntity';
import {Config} from '../../../common/config/private/Config';
import {PasswordHelper} from '../PasswordHelper';
import {DeleteResult} from 'typeorm';
export class SharingManager implements ISharingManager {
private static async removeExpiredLink() {
private static async removeExpiredLink(): Promise<DeleteResult> {
const connection = await SQLConnection.getConnection();
return connection
return await connection
.getRepository(SharingEntity)
.createQueryBuilder('share')
.where('expires < :now', {now: Date.now()})