1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-24 15:04:07 +02:00
Files
misskey/packages/backend/src/server/api/endpoints/admin/get-index-stats.ts
syuilo 4a64280a7c lint
2022-01-03 02:12:50 +09:00

28 lines
545 B
TypeScript

import define from '../../define';
import { getConnection } from 'typeorm';
export const meta = {
requireCredential: true as const,
requireModerator: true,
tags: ['admin'],
params: {
},
};
// eslint-disable-next-line import/no-default-export
export default define(meta, async () => {
const stats = await
getConnection().query(`SELECT * FROM pg_indexes;`)
.then(recs => {
const res = [] as { tablename: string; indexname: string; }[];
for (const rec of recs) {
res.push(rec);
}
return res;
});
return stats;
});