更新一下数据库语句

This commit is contained in:
luchenqun 2017-02-22 13:50:19 +08:00
parent 1378b9ca2c
commit 671b01efd0
2 changed files with 12 additions and 12 deletions

View File

@ -12,19 +12,19 @@ var client = {}
function handleDisconnect() {
client = mysql.createConnection(dbConfig);
client.connect(function(err) { // The server is either down
if (err) { // or restarting (takes a while sometimes).
client.connect(function(err) {
if (err) {
console.log('error when connecting to db:', err);
setTimeout(handleDisconnect, 2000); // We introduce a delay before attempting to reconnect,
} // to avoid a hot loop, and to allow our node script to
}); // process asynchronous requests in the meantime.
// If you're also serving http, display a 503 error.
setTimeout(handleDisconnect, 2000);
}
});
client.on('error', function(err) {
console.log('db error', err);
if (err.code === 'PROTOCOL_CONNECTION_LOST') { // Connection to the MySQL server is usually
handleDisconnect(); // lost due to either server restart, or a
} else { // connnection idle timeout (the wait_timeout
throw err; // server variable configures this)
if (err.code === 'PROTOCOL_CONNECTION_LOST') {
handleDisconnect();
} else {
throw err;
}
});
}
@ -415,7 +415,7 @@ db.getBookmarksTable = function(params) {
if (user_id) {
sql += " AND `user_id` = '" + user_id + "'";
if (params.showStyle == 'card') {
sql += " ORDER BY created_at DESC";
sql += " ORDER BY bookmarks.created_at DESC";
} else {
sql += " ORDER BY click_count DESC";
}

View File

@ -18,7 +18,7 @@
<p>5、可以导入Chrome的书签导出文件暂时做在设置里面。(已完成)</p>
<p>6、书签可以作为公有或者私有公有可供所有人搜索。(暂时可以通过用户名进行搜索,待优化)</p>
<p>7、可以收藏别人的书签。(未完成)</p>
<p>7、可以将书签导出来,然后导入到浏览器。(未完成)</p>
<p>8、可以将书签导出来,然后导入到浏览器。(未完成)</p>
<h2 class="ui dividing header">联系方式</h2>
<p>微信跟扣扣530485521记得备注加书签。</p>
<h2 class="ui dividing header">开发备忘(非开发人员请无视)</h2>