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