src/stale.js

Public method stale

Removes stale representation from disk

Parameters:

  • url must be a String.
    (LRUItem key)

Returns an Object
(TurtleIO instance)

TurtleIO.prototype.stale = function ( url ) { var self = this, cached = this.etags.cache[url], path = this.config.tmp + "/", gz, df; if ( cached ) { path += cached.value.etag; gz = path + ".gz"; df = path + ".zz"; fs.exists( gz, function ( exists ) { if ( exists ) { fs.unlink( gz, function ( e ) { if ( e ) { self.log( e ); } } ); } } ); fs.exists( df, function ( exists ) { if ( exists ) { fs.unlink( df, function ( e ) { if ( e ) { self.log( e ); } } ); } } ); } return this; };