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
bc416c8b
Commit
bc416c8b
authored
Sep 10, 2012
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BAE 下禁用页面缓存。
parent
4936c648
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
core/src/main/java/org/b3log/solo/model/Preference.java
core/src/main/java/org/b3log/solo/model/Preference.java
+10
-2
core/src/main/java/org/b3log/solo/service/PreferenceMgmtService.java
...in/java/org/b3log/solo/service/PreferenceMgmtService.java
+9
-2
No files found.
core/src/main/java/org/b3log/solo/model/Preference.java
View file @
bc416c8b
...
...
@@ -18,6 +18,8 @@ package org.b3log.solo.model;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.RuntimeEnv
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
...
...
@@ -25,7 +27,7 @@ import org.json.JSONObject;
* This class defines all comment model relevant keys.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.1.0.
6, May 4
, 2012
* @version 1.1.0.
7, Sep 10
, 2012
* @since 0.3.1
*/
public
final
class
Preference
{
...
...
@@ -296,7 +298,7 @@ public final class Preference {
/**
* Default page cache enabled.
*/
public
static
final
boolean
DEFAULT_PAGE_CACHE_ENABLED
=
true
;
public
static
final
boolean
DEFAULT_PAGE_CACHE_ENABLED
;
/**
* Default allow visit draft via permalink.
*/
...
...
@@ -356,6 +358,12 @@ public final class Preference {
+
"${postTitle}</a>] received an reply: <p>${replier}"
+
": <span><a href='${replyURL}'>${replyContent}</a></span></p>"
);
DEFAULT_REPLY_NOTIFICATION_TEMPLATE
=
replyNotificationTemplate
.
toString
();
if
(
RuntimeEnv
.
BAE
==
Latkes
.
getRuntimeEnv
())
{
DEFAULT_PAGE_CACHE_ENABLED
=
false
;
// https://github.com/b3log/b3log-solo/issues/73
}
else
{
DEFAULT_PAGE_CACHE_ENABLED
=
true
;
}
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
SEVERE
,
"Creates sign error!"
,
e
);
throw
new
IllegalStateException
(
e
);
...
...
core/src/main/java/org/b3log/solo/service/PreferenceMgmtService.java
View file @
bc416c8b
...
...
@@ -28,6 +28,7 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Latkes
;
import
org.b3log.latke.RuntimeEnv
;
import
org.b3log.latke.repository.RepositoryException
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.latke.service.ServiceException
;
...
...
@@ -142,7 +143,7 @@ public final class PreferenceMgmtService {
final
String
skinPath
=
webRootPath
+
Skin
.
SKINS
+
"/"
+
skinDirName
;
LOGGER
.
log
(
Level
.
FINER
,
"Skin path[{0}]"
,
skinPath
);
Templates
.
CACHE
.
clear
();
preference
.
put
(
Skin
.
SKINS
,
skinArray
.
toString
());
final
String
timeZoneId
=
preference
.
getString
(
TIME_ZONE_ID
);
...
...
@@ -156,8 +157,14 @@ public final class PreferenceMgmtService {
if
(!
preference
.
has
(
PAGE_CACHE_ENABLED
))
{
preference
.
put
(
PAGE_CACHE_ENABLED
,
oldPreference
.
getBoolean
(
PAGE_CACHE_ENABLED
));
}
else
{
if
(
RuntimeEnv
.
BAE
==
Latkes
.
getRuntimeEnv
())
{
// XXX: Ignores user's setting, uses default
// https://github.com/b3log/b3log-solo/issues/73
preference
.
put
(
PAGE_CACHE_ENABLED
,
Default
.
DEFAULT_PAGE_CACHE_ENABLED
);
}
}
final
boolean
pageCacheEnabled
=
preference
.
getBoolean
(
Preference
.
PAGE_CACHE_ENABLED
);
Templates
.
enableCache
(
pageCacheEnabled
);
...
...
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