Merge pull request #518 from resin-io/485-update-interval

Change update check interval to once a day
This commit is contained in:
CameronDiver 2017-05-24 11:12:54 -07:00 committed by GitHub
commit ec386b807f
3 changed files with 10 additions and 7 deletions

View File

@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Reduce granularity of update checking to one day
- Include extra usage metadata in error logging to help debugging
- Add uploading of build logs when present with resin deploy
- Highlight cache usage in a local build

View File

@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var isRoot, notifier, packageJSON, updateNotifier;
var isRoot, notifier, packageJSON, resinUpdateInterval, updateNotifier;
updateNotifier = require('update-notifier');
@ -23,10 +23,12 @@ isRoot = require('is-root');
packageJSON = require('../../package.json');
resinUpdateInterval = 1000 * 60 * 60 * 24 * 1;
if (!isRoot()) {
notifier = updateNotifier({
pkg: packageJSON,
updateCheckInterval: 0
updateCheckInterval: resinUpdateInterval
});
}

View File

@ -18,17 +18,17 @@ updateNotifier = require('update-notifier')
isRoot = require('is-root')
packageJSON = require('../../package.json')
# Check for an update once a day. 1 day granularity should be
# enough, rather than every run.
resinUpdateInterval = 1000 * 60 * 60 * 24 * 1
# `update-notifier` creates files to make the next
# running time ask for updated, however this can lead
# to ugly EPERM issues if those files are created as root.
if not isRoot()
notifier = updateNotifier
pkg: packageJSON
# Force update notification alert
# to be shown every time there is
# an update.
updateCheckInterval: 0
updateCheckInterval: resinUpdateInterval
exports.hasAvailableUpdate = ->
return notifier?