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
8866c530
Unverified
Commit
8866c530
authored
1 year ago
by
anatawa12
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(backend): エポックを固定することで年越し時にトレンドが壊れる問題を修正 (#12567)
parent
920e5211
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/backend/src/core/FeaturedService.ts
+3
-1
3 additions, 1 deletion
packages/backend/src/core/FeaturedService.ts
with
4 additions
and
1 deletion
CHANGELOG.md
+
1
−
0
View file @
8866c530
...
...
@@ -58,6 +58,7 @@
-
Fix: Social/Local/Home Timelineにてインスタンスミュートが効かない問題
-
Fix: ユーザのノート一覧にてインスタンスミュートが効かない問題
-
Fix: チャンネルのノート一覧にてインスタンスミュートが効かない問題
-
Fix: 「みつける」が年越し時に壊れる問題を修正
## 2023.11.1
...
...
This diff is collapsed.
Click to expand it.
packages/backend/src/core/FeaturedService.ts
+
3
−
1
View file @
8866c530
...
...
@@ -14,6 +14,8 @@ export const GALLERY_POSTS_RANKING_WINDOW = 1000 * 60 * 60 * 24 * 3; // 3日ご
const
PER_USER_NOTES_RANKING_WINDOW
=
1000
*
60
*
60
*
24
*
7
;
// 1週間ごと
const
HASHTAG_RANKING_WINDOW
=
1000
*
60
*
60
;
// 1時間ごと
const
featuredEpoc
=
new
Date
(
'
2023-01-01T00:00:00Z
'
).
getTime
();
@
Injectable
()
export
class
FeaturedService
{
constructor
(
...
...
@@ -24,7 +26,7 @@ export class FeaturedService {
@
bindThis
private
getCurrentWindow
(
windowRange
:
number
):
number
{
const
passed
=
new
Date
().
getTime
()
-
new
Date
(
new
Date
().
getFullYear
(),
0
,
1
).
getTime
()
;
const
passed
=
new
Date
().
getTime
()
-
featuredEpoc
;
return
Math
.
floor
(
passed
/
windowRange
);
}
...
...
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