Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
342
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
28
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
TransFem.org
Sharkey
Commits
d37a7343
Commit
d37a7343
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix(server): fix aggregation of retention
parent
7cb13cf8
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/queue/processors/AggregateRetentionProcessorService.ts
+8
-1
8 additions, 1 deletion
...rc/queue/processors/AggregateRetentionProcessorService.ts
with
8 additions
and
1 deletion
packages/backend/src/queue/processors/AggregateRetentionProcessorService.ts
+
8
−
1
View file @
d37a7343
...
...
@@ -57,8 +57,15 @@ export class AggregateRetentionProcessorService {
usersCount
:
targetUserIds
.
length
,
});
// 今日活動したユーザーを全て取得
const
activeUsers
=
await
this
.
usersRepository
.
findBy
({
host
:
IsNull
(),
lastActiveDate
:
MoreThan
(
new
Date
(
Date
.
now
()
-
(
1000
*
60
*
60
*
24
))),
});
const
activeUsersIds
=
activeUsers
.
map
(
u
=>
u
.
id
);
for
(
const
record
of
pastRecords
)
{
const
retention
=
record
.
userIds
.
filter
(
id
=>
target
UserIds
.
includes
(
id
)).
length
;
const
retention
=
record
.
userIds
.
filter
(
id
=>
active
User
s
Ids
.
includes
(
id
)).
length
;
const
data
=
deepClone
(
record
.
data
);
data
[
dateKey
]
=
retention
;
...
...
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