mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-03 02:56:43 -06:00
1c67c26bd8
* wip * wip * wip * Update following.ts * wip * wip * wip * Update resolve-user.ts * maxQueryExecutionTime * wip * wip
27 lines
584 B
TypeScript
27 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,
|
|
};
|
|
});
|