Skip to content

Commit

Permalink
refactoring: removing abe-time-mesure.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 2, 2016
1 parent c1ee8c3 commit 5e9a80e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 57 deletions.
38 changes: 0 additions & 38 deletions src/cli/helpers/abe-time-mesure.js

This file was deleted.

7 changes: 0 additions & 7 deletions src/cli/helpers/abe-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
,getAttr
,Hooks
,Plugins
,TimeMesure
} from '../'

export default class Utils {
Expand Down Expand Up @@ -445,7 +444,6 @@ export default class Utils {

static nextDataList(tplPath, jsonPage, match) {
var p = new Promise((resolve, reject) => {
// var t = new TimeMesure()
if(typeof jsonPage['abe_source'] === 'undefined' || jsonPage['abe_source'] === null) {
jsonPage['abe_source'] = {}
}
Expand All @@ -459,7 +457,6 @@ export default class Utils {
case 'request':
Utils.requestList(obj, tplPath, match, jsonPage)
.then(() => {
// t.duration(match)
resolve()
}).catch((e) => {
console.log('[ERROR] abe-utils.js requestList', e)
Expand Down Expand Up @@ -500,23 +497,19 @@ export default class Utils {

static getDataList(tplPath, text, jsonPage) {
var p = new Promise((resolve, reject) => {
// var t = new TimeMesure('getDataList')

var promises = []
let util = new Utils()
var matches = util.dataRequest(text)
Array.prototype.forEach.call(matches, (match) => {
promises.push(Utils.nextDataList(tplPath, jsonPage, match[0]))
})

Promise.all(promises)
.then(() => {
// t.duration()
resolve()
}).catch(function(e) {
console.error('abe-utils.js getDataList', e)
})
// return filesRequest
}).catch(function(e) {
console.error('abe-utils.js getDataList', e)
})
Expand Down
3 changes: 0 additions & 3 deletions src/cli/helpers/file-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
,Hooks
,Plugins
,Manager
,TimeMesure
} from '../'

export default class FileParser {
Expand Down Expand Up @@ -398,7 +397,6 @@ export default class FileParser {
var i = 0

files.forEach(function (file) {
// var t = new TimeMesure('add files')
var cleanFile = file
var json = FileParser.getJson(file.path)

Expand Down Expand Up @@ -431,7 +429,6 @@ export default class FileParser {
cleanFile[keyFirst] = json[keyFirst]
})
filesArr.push(cleanFile)
// t.duration()
})

var merged = fileUtils.getFilesMerged(filesArr)
Expand Down
2 changes: 0 additions & 2 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import Plugins from './helpers/abe-plugins'
import Locales from './helpers/abe-locales'

import getSelectTemplateKeys from './helpers/abe-get-select-template-keys'
import TimeMesure from './helpers/abe-time-mesure'

export {
fileAttr
Expand Down Expand Up @@ -105,7 +104,6 @@ export {
,Manager
,Page
,getSelectTemplateKeys
,TimeMesure
}

export {compileAbe as compileAbe}
7 changes: 0 additions & 7 deletions src/cli/models/Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
FileParser,
fileUtils,
folderUtils,
TimeMesure,
getSelectTemplateKeys
} from '../../cli'

Expand Down Expand Up @@ -55,7 +54,6 @@ class Manager {
init() {
this._whereKeys = []
var p = new Promise((resolve, reject) => {
this._loadTime = new TimeMesure('Loading Manager')
const pathTemplate = path.join(config.root, config.templates.url)
getSelectTemplateKeys(pathTemplate)
.then((whereKeys) => {
Expand All @@ -75,16 +73,11 @@ class Manager {
}

updateList() {
if(typeof this._loadTime === 'undefined' || this._loadTime === null) {
this._loadTime = new TimeMesure('Loading Manager')
}
this._list = FileParser.getAllFilesWithKeys(this._whereKeys)
this._list.sort(FileParser.predicatBy('date', -1))
if(config.redis.enable){
redis.get().set('list', JSON.stringify(this._list))
}
this._loadTime.duration()
delete this._loadTime

return this
}
Expand Down

0 comments on commit 5e9a80e

Please sign in to comment.