Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
08d0a45e
Unverified
Commit
08d0a45e
authored
3 years ago
by
xianon
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: NodeInfo のユーザー数と投稿数の内容を見直す (#8255)
* NodeInfoのアクティブユーザーの取得方法を変更する * NodeInfoの投稿数の出力内容を見直す
parent
be15c8f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/backend/src/server/nodeinfo.ts
+5
-7
5 additions, 7 deletions
packages/backend/src/server/nodeinfo.ts
with
5 additions
and
7 deletions
packages/backend/src/server/nodeinfo.ts
+
5
−
7
View file @
08d0a45e
...
...
@@ -2,7 +2,7 @@ import * as Router from '@koa/router';
import
config
from
'
@/config/index
'
;
import
{
fetchMeta
}
from
'
@/misc/fetch-meta
'
;
import
{
Users
,
Notes
}
from
'
@/models/index
'
;
import
{
Not
,
IsNull
,
MoreThan
}
from
'
typeorm
'
;
import
{
MoreThan
}
from
'
typeorm
'
;
const
router
=
new
Router
();
...
...
@@ -25,14 +25,12 @@ const nodeinfo2 = async () => {
activeHalfyear
,
activeMonth
,
localPosts
,
localComments
,
]
=
await
Promise
.
all
([
fetchMeta
(
true
),
Users
.
count
({
where
:
{
host
:
null
}
}),
Users
.
count
({
where
:
{
host
:
null
,
updatedAt
:
MoreThan
(
new
Date
(
now
-
15552000000
))
}
}),
Users
.
count
({
where
:
{
host
:
null
,
updatedAt
:
MoreThan
(
new
Date
(
now
-
2592000000
))
}
}),
Notes
.
count
({
where
:
{
userHost
:
null
,
replyId
:
null
}
}),
Notes
.
count
({
where
:
{
userHost
:
null
,
replyId
:
Not
(
IsNull
())
}
}),
Users
.
count
({
where
:
{
host
:
null
,
lastActiveDate
:
MoreThan
(
new
Date
(
now
-
15552000000
))
}
}),
Users
.
count
({
where
:
{
host
:
null
,
lastActiveDate
:
MoreThan
(
new
Date
(
now
-
2592000000
))
}
}),
Notes
.
count
({
where
:
{
userHost
:
null
}
}),
]);
const
proxyAccount
=
meta
.
proxyAccountId
?
await
Users
.
pack
(
meta
.
proxyAccountId
).
catch
(()
=>
null
)
:
null
;
...
...
@@ -52,7 +50,7 @@ const nodeinfo2 = async () => {
usage
:
{
users
:
{
total
,
activeHalfyear
,
activeMonth
},
localPosts
,
localComments
,
localComments
:
0
,
},
metadata
:
{
nodeName
:
meta
.
name
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment