mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-26 12:38:07 +09:00
34 lines
512 B
TypeScript
34 lines
512 B
TypeScript
|
import $ from 'cafy';
|
||
|
import define from '../../define';
|
||
|
import { getConnection } from 'typeorm';
|
||
|
|
||
|
export const meta = {
|
||
|
tags: ['admin'],
|
||
|
|
||
|
requireCredential: true,
|
||
|
requireModerator: true,
|
||
|
|
||
|
params: {
|
||
|
full: {
|
||
|
validator: $.bool,
|
||
|
},
|
||
|
analyze: {
|
||
|
validator: $.bool,
|
||
|
},
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default define(meta, async (ps) => {
|
||
|
const params: string[] = [];
|
||
|
|
||
|
if (ps.full) {
|
||
|
params.push('FULL');
|
||
|
}
|
||
|
|
||
|
if (ps.analyze) {
|
||
|
params.push('ANALYZE');
|
||
|
}
|
||
|
|
||
|
getConnection().query('VACUUM ' + params.join(' '));
|
||
|
});
|