Commit 5171aeac authored by Liang Ding's avatar Liang Ding

🎨 #13

parent 26e2872d
...@@ -58,7 +58,7 @@ public final class Option { ...@@ -58,7 +58,7 @@ public final class Option {
public static final String ID_C_HLJS_THEME = "hljsTheme"; public static final String ID_C_HLJS_THEME = "hljsTheme";
/** /**
* Key of enable sync (push) GitHub. 导出文章到仓库 https://hacpai.com/article/1557238327458 * Key of enable backup public articles to HacPai. 备份公开文章到社区 https://hacpai.com/article/1557238327458
*/ */
public static final String ID_C_SYNC_GITHUB = "syncGitHub"; public static final String ID_C_SYNC_GITHUB = "syncGitHub";
......
...@@ -108,7 +108,7 @@ public class CronMgmtService { ...@@ -108,7 +108,7 @@ public class CronMgmtService {
SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(() -> { SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(() -> {
try { try {
exportService.exportGitHubRepo(); exportService.exportHacPai();
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Executes cron failed", e); LOGGER.log(Level.ERROR, "Executes cron failed", e);
} finally { } finally {
......
...@@ -259,10 +259,10 @@ public class ExportService { ...@@ -259,10 +259,10 @@ public class ExportService {
} }
/** /**
* Exports public articles to admin's GitHub repos. 博文定时同步 GitHub 仓库 https://hacpai.com/article/1557238327458 * Exports public articles to admin's HacPai account.
*/ */
public void exportGitHubRepo() { public void exportHacPai() {
LOGGER.log(Level.INFO, "Github repo syncing...."); LOGGER.log(Level.INFO, "Backup public articles to HacPai....");
try { try {
final JSONObject preference = optionQueryService.getPreference(); final JSONObject preference = optionQueryService.getPreference();
if (null == preference) { if (null == preference) {
...@@ -384,11 +384,9 @@ public class ExportService { ...@@ -384,11 +384,9 @@ public class ExportService {
"file", zipData).send(); "file", zipData).send();
response.close(); response.close();
response.charset("UTF-8"); response.charset("UTF-8");
LOGGER.info("Github repo sync completed: " + response.bodyText()); LOGGER.info("Backup public articles to HacPai completed: " + response.bodyText());
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.log(Level.ERROR, "Exports articles to github repo failed", e); LOGGER.log(Level.ERROR, "Exports articles to github repo failed:" + e.getMessage());
} finally {
LOGGER.log(Level.INFO, "Github repo synced");
} }
} }
......
...@@ -29,8 +29,8 @@ configSiteLabel=Go to the site link to configure GitHub, Twitter, etc. ...@@ -29,8 +29,8 @@ configSiteLabel=Go to the site link to configure GitHub, Twitter, etc.
hljsThemeLabel=hljs theme: hljsThemeLabel=hljs theme:
tocLabel=ToC tocLabel=ToC
removeUnusedArchivesLabel=Remove Unused Archives removeUnusedArchivesLabel=Remove Unused Archives
syncGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">Allow sync GitHub repo</a>: syncGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">Backup public articles to HacPai</a>:
pullGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">Allow pull GitHub repo</a>: pullGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">Allow to pull GitHub repositories</a>:
queryUserFailedLabel=Query user info failed queryUserFailedLabel=Query user info failed
commentContentLabel=Content commentContentLabel=Content
cancelLabel=Cancel cancelLabel=Cancel
......
...@@ -29,8 +29,8 @@ configSiteLabel=\u524D\u5F80\u914D\u7F6E GitHub\uFF0CTwitter \u7B49\u7AD9\u70B9\ ...@@ -29,8 +29,8 @@ configSiteLabel=\u524D\u5F80\u914D\u7F6E GitHub\uFF0CTwitter \u7B49\u7AD9\u70B9\
hljsThemeLabel=\u4EE3\u7801\u9AD8\u4EAE\u4E3B\u9898\uFF1A hljsThemeLabel=\u4EE3\u7801\u9AD8\u4EAE\u4E3B\u9898\uFF1A
tocLabel=\u76EE\u5F55 tocLabel=\u76EE\u5F55
removeUnusedArchivesLabel=\u79FB\u9664\u672A\u4F7F\u7528\u5B58\u6863 removeUnusedArchivesLabel=\u79FB\u9664\u672A\u4F7F\u7528\u5B58\u6863
syncGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">\u5141\u8BB8\u540C\u6B65 GitHub \u4ED3\u5E93</a>\uFF1A syncGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">\u5907\u4EFD\u516C\u5F00\u6587\u7AE0\u5230\u793E\u533A</a>\uFF1A
pullGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">\u5141\u8BB8\u62C9\u53D6 GitHub \u4ED3\u5E93</a>\uFF1A pullGitHubLabel=<a href="https://hacpai.com/article/1557238327458" target="_blank">\u62C9\u53D6 GitHub \u4ED3\u5E93\u4FE1\u606F</a>\uFF1A
queryUserFailedLabel=\u67E5\u8BE2\u7528\u6237\u4FE1\u606F\u5931\u8D25 queryUserFailedLabel=\u67E5\u8BE2\u7528\u6237\u4FE1\u606F\u5931\u8D25
commentContentLabel=\u8BC4\u8BBA\u5185\u5BB9 commentContentLabel=\u8BC4\u8BBA\u5185\u5BB9
cancelLabel=\u53D6\u6D88 cancelLabel=\u53D6\u6D88
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment