mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-14 11:23:17 +02:00
improved logging
This commit is contained in:
parent
c08a2b35ba
commit
a95cd837cd
@ -69,6 +69,7 @@ export class SharingMWs {
|
|||||||
return next();
|
return next();
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.warn(err);
|
||||||
return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during creating sharing link', err));
|
return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during creating sharing link', err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,12 +4,13 @@ import {SQLConnection} from './SQLConnection';
|
|||||||
import {SharingEntity} from './enitites/SharingEntity';
|
import {SharingEntity} from './enitites/SharingEntity';
|
||||||
import {Config} from '../../../common/config/private/Config';
|
import {Config} from '../../../common/config/private/Config';
|
||||||
import {PasswordHelper} from '../PasswordHelper';
|
import {PasswordHelper} from '../PasswordHelper';
|
||||||
|
import {DeleteResult} from 'typeorm';
|
||||||
|
|
||||||
export class SharingManager implements ISharingManager {
|
export class SharingManager implements ISharingManager {
|
||||||
|
|
||||||
private static async removeExpiredLink() {
|
private static async removeExpiredLink(): Promise<DeleteResult> {
|
||||||
const connection = await SQLConnection.getConnection();
|
const connection = await SQLConnection.getConnection();
|
||||||
return connection
|
return await connection
|
||||||
.getRepository(SharingEntity)
|
.getRepository(SharingEntity)
|
||||||
.createQueryBuilder('share')
|
.createQueryBuilder('share')
|
||||||
.where('expires < :now', {now: Date.now()})
|
.where('expires < :now', {now: Date.now()})
|
||||||
|
Loading…
Reference in New Issue
Block a user