Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
ngot committed Mar 28, 2018
1 parent 519e164 commit e0a7a77
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
9 changes: 1 addition & 8 deletions lib/mq_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const is = require('is-type-of');
const gather = require('p-gather');
const sleep = require('mz-modules/sleep');
const utility = require('utility');
const MixAll = require('./mix_all');
const MQClientAPI = require('./mq_client_api');
Expand Down Expand Up @@ -683,11 +684,3 @@ class MQClient extends MQClientAPI {
}

module.exports = MQClient;

// Helper
// -----------------
function sleep(n) {
return new Promise(resolve => {
setTimeout(resolve, n);
});
}
6 changes: 3 additions & 3 deletions lib/store/local_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LocalFileOffsetStore extends Base {
* @param {Array} mqs -
* @return {void}
*/
* persistAll(mqs) {
async persistAll(mqs) {
if (mqs && mqs.length) {
const data = {
offsetTable: {},
Expand All @@ -138,7 +138,7 @@ class LocalFileOffsetStore extends Base {
* 持久化消费进度
* @return {void}
*/
* persist() {}
async persist() {}

/* eslint-enable no-empty-function */

Expand All @@ -157,7 +157,7 @@ class LocalFileOffsetStore extends Base {
* 从本地文件读消费进度
* @return {void}
*/
* readLocalOffset() {
async readLocalOffset() {
if (!fs.existsSync(this.storePath)) {
return null;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/store/local_memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class LocalMemoryOffsetStore extends Base {
* @param {Function} callback 回调函数
* @return {void}
*/
* readOffset(messageQueue, type) {
async readOffset(messageQueue, type) {
if (!messageQueue) {
return -1;
}
Expand All @@ -76,11 +76,11 @@ class LocalMemoryOffsetStore extends Base {

/* eslint-disable no-empty-function */

* load() {}
async load() {}

* persistAll() {}
async persistAll() {}

* persist() {}
async persist() {}

/* eslint-enable no-empty-function */

Expand Down

0 comments on commit e0a7a77

Please sign in to comment.