src/unregister.js

Method unregister

Unregisters an Etag in the LRU cache and removes stale representation from disk

Parameters:

  • url must be a String.
    (URL requested)

Returns an Object
(TurtleIO instance)

TurtleIO.prototype.unregister = function ( url ) { var self = this, cached = this.etags.cache[url], path = this.config.tmp + "/", gz, df; if ( cached ) { this.etags.remove( url ); 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; };