@@ -30,7 +30,7 @@
Loading
30 30
    mrulesTime: config.mrulesTime,
31 31
    mvaluesClientId: config.mvaluesClientId,
32 32
    mvaluesTime: config.mvaluesTime,
33 -
    latestVersion: properties.get('latestVersion'),
33 +
    latestVersion: properties.getLatestVersion('latestVersion'),
34 34
    server: util.getServerInfo(req),
35 35
    uploadFiles: getUploadFiles(),
36 36
    rules: getRules(),

@@ -30,7 +30,7 @@
Loading
30 30
    baseDir: config.baseDirHash,
31 31
    username: config.username,
32 32
    nodeVersion: process.version,
33 -
    latestVersion: properties.get('latestVersion'),
33 +
    latestVersion: properties.getLatestVersion('latestVersion'),
34 34
    host: util.hostname(),
35 35
    isWin: util.isWin,
36 36
    port: config.port,

@@ -27,7 +27,7 @@
Loading
27 27
module.exports = function(req, res) {
28 28
  var version = config.version;
29 29
  var doNotShowAgainVersion = properties.get('doNotShowAgainVersion');
30 -
  var latestVersion = properties.get('latestVersion');
30 +
  var latestVersion = properties.getLatestVersion('latestVersion');
31 31
32 32
  res.json({
33 33
    ec: 0,

@@ -1,7 +1,7 @@
Loading
1 1
var properties = require('../../../lib/rules/util').properties;
2 2
3 3
module.exports = function(req, res) {
4 -
  properties.set('doNotShowAgainVersion', properties.get('latestVersion'));
4 +
  properties.set('doNotShowAgainVersion', properties.getLatestVersion('latestVersion'));
5 5
  res.json({ec: 0, em: 'success'});
6 6
};
7 7

@@ -493,7 +493,7 @@
Loading
493 493
494 494
setTimeout(function getWhistleVersion() {
495 495
  util.getLatestVersion(config.registry, function(ver) {
496 -
    ver && propertiesStorage.setProperty('latestVersion', ver);
496 +
    ver && propertiesStorage.writeFile('latestVersion', ver);
497 497
    setTimeout(getWhistleVersion, INTERVAL);
498 498
  });
499 499
}, 1000); //等待package的信息配置更新完成
@@ -510,6 +510,10 @@
Loading
510 510
}
511 511
512 512
exports.properties = {
513 +
  getLatestVersion: function() {
514 +
    var version = propertiesStorage.readFile('latestVersion');
515 +
    return typeof version === 'string' && version.length < 60 ? version : '';
516 +
  },
513 517
  isEnableCapture: function() {
514 518
    if (config.multiEnv) {
515 519
      return false;
Files Coverage
biz 66.87%
lib 74.41%
index.js 87.50%
Project Totals (89 files) 73.93%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading