mirror of
https://github.com/MisskeyIO/misskey
synced 2024-12-23 11:08:22 +09:00
1c67c26bd8
* wip * wip * wip * Update following.ts * wip * wip * wip * Update resolve-user.ts * maxQueryExecutionTime * wip * wip
28 lines
584 B
TypeScript
28 lines
584 B
TypeScript
import { USER_ONLINE_THRESHOLD } from '@/const.js';
|
|
import { Users } from '@/models/index.js';
|
|
import { MoreThan } from 'typeorm';
|
|
import define from '../define.js';
|
|
|
|
export const meta = {
|
|
tags: ['meta'],
|
|
|
|
requireCredential: false,
|
|
} as const;
|
|
|
|
export const paramDef = {
|
|
type: 'object',
|
|
properties: {},
|
|
required: [],
|
|
} as const;
|
|
|
|
// eslint-disable-next-line import/no-default-export
|
|
export default define(meta, paramDef, async () => {
|
|
const count = await Users.countBy({
|
|
lastActiveDate: MoreThan(new Date(Date.now() - USER_ONLINE_THRESHOLD)),
|
|
});
|
|
|
|
return {
|
|
count,
|
|
};
|
|
});
|