Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo
Commits
ddfd35dc
Commit
ddfd35dc
authored
May 31, 2012
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
83b99fec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
core/src/main/java/org/b3log/solo/processor/StatProcessor.java
...src/main/java/org/b3log/solo/processor/StatProcessor.java
+6
-6
No files found.
core/src/main/java/org/b3log/solo/processor/StatProcessor.java
View file @
ddfd35dc
...
...
@@ -20,6 +20,7 @@ import java.util.Set;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.RuntimeEnv
;
import
org.b3log.latke.action.AbstractCacheablePageAction
;
import
org.b3log.latke.annotation.RequestProcessing
;
import
org.b3log.latke.annotation.RequestProcessor
;
...
...
@@ -130,21 +131,21 @@ public final class StatProcessor {
}
final
int
hitCount
=
cachedPage
.
optInt
(
PageCaches
.
CACHED_HIT_COUNT
);
if
(
2
>
hitCount
)
{
if
(
2
>
hitCount
&&
RuntimeEnv
.
GAE
==
Latkes
.
getRuntimeEnv
()
)
{
// Skips for view count tiny-changes, reduces Datastore Write Quota for Solo GAE version
continue
;
}
final
String
articleId
=
cachedPage
.
optString
(
AbstractCacheablePageAction
.
CACHED_OID
);
LOGGER
.
log
(
Level
.
FINER
,
"Updating article[id={0}, title={1}] view count"
,
new
Object
[]{
articleId
,
cachedPage
.
optString
(
AbstractCacheablePageAction
.
CACHED_TITLE
)});
final
JSONObject
article
=
articleRepository
.
get
(
articleId
);
if
(
null
==
article
)
{
continue
;
}
LOGGER
.
log
(
Level
.
FINER
,
"Updating article[id={0}, title={1}] view count"
,
new
Object
[]{
articleId
,
cachedPage
.
optString
(
AbstractCacheablePageAction
.
CACHED_TITLE
)});
final
int
oldViewCount
=
article
.
optInt
(
Article
.
ARTICLE_VIEW_COUNT
);
final
int
viewCount
=
oldViewCount
+
hitCount
;
...
...
@@ -155,8 +156,7 @@ public final class StatProcessor {
cachedPage
.
put
(
PageCaches
.
CACHED_HIT_COUNT
,
0
);
LOGGER
.
log
(
Level
.
FINER
,
"Updating article[id={0}, title={1}] view count from [{2}] to [{3}]"
,
new
Object
[]{
articleId
,
cachedPage
.
optString
(
AbstractCacheablePageAction
.
CACHED_TITLE
),
oldViewCount
,
viewCount
});
new
Object
[]{
articleId
,
article
.
optString
(
Article
.
ARTICLE_TITLE
),
oldViewCount
,
viewCount
});
}
transaction
.
commit
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment