Fix users stats
This commit is contained in:
parent
82eb78504f
commit
5e0dbb3e52
4 changed files with 10 additions and 6 deletions
|
@ -819,10 +819,10 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
|
|||
}
|
||||
}
|
||||
|
||||
return UserModel.count(query)
|
||||
return UserModel.unscoped().count(query)
|
||||
}
|
||||
|
||||
const totalUsers = await UserModel.count()
|
||||
const totalUsers = await UserModel.unscoped().count()
|
||||
const totalDailyActiveUsers = await getActiveUsers(1)
|
||||
const totalWeeklyActiveUsers = await getActiveUsers(7)
|
||||
const totalMonthlyActiveUsers = await getActiveUsers(30)
|
||||
|
|
|
@ -683,11 +683,11 @@ export class VideoCommentModel extends Model<Partial<AttributesOnly<VideoComment
|
|||
const totalLocalVideoComments = await VideoCommentModel.count({
|
||||
include: [
|
||||
{
|
||||
model: AccountModel,
|
||||
model: AccountModel.unscoped(),
|
||||
required: true,
|
||||
include: [
|
||||
{
|
||||
model: ActorModel,
|
||||
model: ActorModel.unscoped(),
|
||||
required: true,
|
||||
where: {
|
||||
serverId: null
|
||||
|
|
|
@ -617,11 +617,11 @@ export class VideoPlaylistModel extends Model<Partial<AttributesOnly<VideoPlayli
|
|||
const totalLocalPlaylists = await VideoPlaylistModel.count({
|
||||
include: [
|
||||
{
|
||||
model: AccountModel,
|
||||
model: AccountModel.unscoped(),
|
||||
required: true,
|
||||
include: [
|
||||
{
|
||||
model: ActorModel,
|
||||
model: ActorModel.unscoped(),
|
||||
required: true,
|
||||
where: {
|
||||
serverId: null
|
||||
|
|
|
@ -10,6 +10,8 @@ import {
|
|||
doubleFollow,
|
||||
PeerTubeServer,
|
||||
setAccessTokensToServers,
|
||||
setDefaultAccountAvatar,
|
||||
setDefaultChannelAvatar,
|
||||
waitJobs
|
||||
} from '@shared/server-commands'
|
||||
|
||||
|
@ -29,6 +31,8 @@ describe('Test stats (excluding redundancy)', function () {
|
|||
servers = await createMultipleServers(3)
|
||||
|
||||
await setAccessTokensToServers(servers)
|
||||
await setDefaultChannelAvatar(servers)
|
||||
await setDefaultAccountAvatar(servers)
|
||||
|
||||
await doubleFollow(servers[0], servers[1])
|
||||
|
||||
|
|
Loading…
Reference in a new issue