update dependencies
This commit is contained in:
parent
186179d132
commit
8a34731e8c
10
dist/index.js
vendored
10
dist/index.js
vendored
@ -27,11 +27,11 @@ class SmartUpdate {
|
||||
let result = yield this.kvStore.readKey(npmnameArg);
|
||||
if (result) {
|
||||
let lastCheckTimeStamp = smarttime_1.TimeStamp.fromMilliSeconds(result.lastCheck);
|
||||
let compareTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 });
|
||||
if (!lastCheckTimeStamp.isOlderThan(timeStamp, compareTime)) {
|
||||
let tresholdTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 });
|
||||
if (!lastCheckTimeStamp.isOlderThan(timeStamp, tresholdTime)) {
|
||||
newData.lastCheck = lastCheckTimeStamp.milliSeconds;
|
||||
let nextCheckInMinutes = (timeStamp.milliSeconds - lastCheckTimeStamp.milliSeconds) / 60000;
|
||||
plugins.beautylog.log(`smartupdate: next check in ${nextCheckInMinutes}: ` +
|
||||
let nextCheckInMinutes = (tresholdTime - (timeStamp.milliSeconds - lastCheckTimeStamp.milliSeconds)) / 60000;
|
||||
plugins.beautylog.log(`smartupdate: next check in ${Math.round(nextCheckInMinutes)} minutes: ` +
|
||||
`${plugins.beautycolor.coloredString(`${npmnameArg} has already been checked within the last hour.`, 'pink')}`);
|
||||
return;
|
||||
}
|
||||
@ -75,4 +75,4 @@ class SmartUpdate {
|
||||
}
|
||||
exports.SmartUpdate = SmartUpdate;
|
||||
exports.standardHandler = new SmartUpdate();
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsaURBQWdEO0FBRWhELHlDQUFxQztBQVVyQztJQUFBO1FBQ0UsWUFBTyxHQUFHLElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQU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
"smarttime": "^1.0.9",
|
||||
"smartversion": "^1.0.3",
|
||||
"typings-global": "^1.0.20"
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import { expect, tap } from 'tapbundle'
|
||||
import * as smartupdate from '../ts/index'
|
||||
|
||||
tap.test('should check for a npm module', async () => {
|
||||
await smartupdate.standardHandler.check('npmts', '8.0.5', 'http://gitzone.gitlab.io/npmts/changelog.html')
|
||||
await smartupdate.standardHandler.check('lodash', '1.0.5', 'http://gitzone.gitlab.io/npmts/changelog.html')
|
||||
})
|
||||
|
||||
tap.start()
|
||||
|
@ -28,12 +28,12 @@ export class SmartUpdate {
|
||||
|
||||
if (result) {
|
||||
let lastCheckTimeStamp = TimeStamp.fromMilliSeconds(result.lastCheck)
|
||||
let compareTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 })
|
||||
if (!lastCheckTimeStamp.isOlderThan(timeStamp, compareTime)) {
|
||||
let tresholdTime = plugins.smarttime.getMilliSecondsFromUnits({ hours: 1 })
|
||||
if (!lastCheckTimeStamp.isOlderThan(timeStamp, tresholdTime)) {
|
||||
newData.lastCheck = lastCheckTimeStamp.milliSeconds
|
||||
let nextCheckInMinutes = (timeStamp.milliSeconds - lastCheckTimeStamp.milliSeconds) / 60000
|
||||
let nextCheckInMinutes = (tresholdTime - (timeStamp.milliSeconds - lastCheckTimeStamp.milliSeconds)) / 60000
|
||||
plugins.beautylog.log(
|
||||
`smartupdate: next check in ${nextCheckInMinutes}: ` +
|
||||
`smartupdate: next check in ${Math.round(nextCheckInMinutes)} minutes: ` +
|
||||
`${plugins.beautycolor.coloredString(
|
||||
`${npmnameArg} has already been checked within the last hour.`
|
||||
, 'pink'
|
||||
|
@ -711,9 +711,9 @@ smartshell@^1.0.6:
|
||||
typings-global "^1.0.19"
|
||||
which "^1.2.14"
|
||||
|
||||
smarttime@^1.0.7:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/smarttime/-/smarttime-1.0.7.tgz#d3030d7cd71bf58d752e88c81f6f4fd59681efd1"
|
||||
smarttime@^1.0.9:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/smarttime/-/smarttime-1.0.9.tgz#a307bde5bb56207a4bc92eeb416de503dae64fec"
|
||||
dependencies:
|
||||
typings-global "^1.0.16"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user