Работа над ServerStorage

This commit is contained in:
Book Pauk
2019-03-12 23:34:41 +07:00
parent 886af11d3a
commit e473dc8843
4 changed files with 73 additions and 15 deletions

View File

@@ -1,5 +1,8 @@
import _ from 'lodash';
import axios from 'axios';
import {sleep} from '../share/utils';
import {Buffer} from 'safe-buffer';
import * as utils from '../share/utils';
const api = axios.create({
baseURL: '/api/reader'
@@ -41,7 +44,7 @@ class Reader {
throw new Error(errMes);
}
if (i > 0)
await sleep(refreshPause);
await utils.sleep(refreshPause);
i++;
if (i > 120*1000/refreshPause) {//2 мин ждем телодвижений воркера
@@ -116,18 +119,6 @@ class Reader {
return response.data;
}
storageCheck(items) {
return this.storage({action: 'check', items});
}
storageGet(items) {
return this.storage({action: 'get', items});
}
storageSet(items, force) {
return this.storage({action: 'set', force, items});
}
}
export default new Reader();