function cleanAndStore(self, key, value) {
			return new Promise(function (resolve, reject) {
				var attempt = 0;

				_cleanAndStore(self, key, value);

				function _cleanAndStore(self, key, value) {
					attempt++;
					Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: freeing space attempt [" + (attempt) + "]");

					deleteItemAndUpdateMetadata(self).then(function (deletedKey) {
						Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: deleted item with key [" + deletedKey + "]. Going to put " + key);
						return internalSet(self, key, value).then(resolve, function (event) {
							if (isQuotaExceeded(event)) {
								Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: QuotaExceedError during freeing up space...");
								if (getItemCount(self) > 0) {
									_cleanAndStore(self, key, value);
								} else {
									reject("Cache Manager LRUPersistentCache: cleanAndStore: even when the cache is empty, the new item with key [" + key + "] cannot be added");
								}
							} else {
								reject("Cache Manager LRUPersistentCache: cleanAndStore: cannot free space: " + collectErrorData(event));
							}
						});
					}, reject);
				}
			});
		}
/**
		 * Tries to free space until the given new item is successfully added.
		 * @param {sap.ui.core.cache.LRUPersistentCache} self the instance of the Cache Manager
		 * @param {ItemData} oItem the item to free space for
		 * @returns {Promise} a promise that will resolve if the given item is added, or reject - if not.
		 */
Tries to free space until the given new item is successfully added.
@param {sap.ui.core.cache.LRUPersistentCache} self the instance of the Cache Manager
@param {ItemData} oItem the item to free space for
@returns {Promise} a promise that will resolve if the given item is added, or reject - if not.
Tries to free space until the given new item is successfully added . @param { sap . ui . core . cache . LRUPersistentCache } self the instance of the Cache Manager @param { ItemData } oItem the item to free space for @returns { Promise } a promise that will resolve if the given item is added or reject - if not .
function cleanAndStore(self, key, value) {
			return new Promise(function (resolve, reject) {
				var attempt = 0;
				_cleanAndStore(self, key, value);
				function _cleanAndStore(self, key, value) {
					attempt++;
					Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: freeing space attempt [" + (attempt) + "]");
					deleteItemAndUpdateMetadata(self).then(function (deletedKey) {
						Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: deleted item with key [" + deletedKey + "]. Going to put " + key);
						return internalSet(self, key, value).then(resolve, function (event) {
							if (isQuotaExceeded(event)) {
								Log.debug("Cache Manager LRUPersistentCache: cleanAndStore: QuotaExceedError during freeing up space...");
								if (getItemCount(self) > 0) {
									_cleanAndStore(self, key, value);
								} else {
									reject("Cache Manager LRUPersistentCache: cleanAndStore: even when the cache is empty, the new item with key [" + key + "] cannot be added");
								}
							} else {
								reject("Cache Manager LRUPersistentCache: cleanAndStore: cannot free space: " + collectErrorData(event));
							}
						});
					}, reject);
				}
			});
		}
function cleanAndStore ( self , key , value ) { return new Promise ( function ( resolve , reject ) { var attempt = 0 ; _cleanAndStore ( self , key , value ) ; function _cleanAndStore ( self , key , value ) { attempt ++ ; Log . debug ( "Cache Manager LRUPersistentCache: cleanAndStore: freeing space attempt [" + ( attempt ) + "]" ) ; deleteItemAndUpdateMetadata ( self ) . then ( function ( deletedKey ) { Log . debug ( "Cache Manager LRUPersistentCache: cleanAndStore: deleted item with key [" + deletedKey + "]. Going to put " + key ) ; return internalSet ( self , key , value ) . then ( resolve , function ( event ) { if ( isQuotaExceeded ( event ) ) { Log . debug ( "Cache Manager LRUPersistentCache: cleanAndStore: QuotaExceedError during freeing up space..." ) ; if ( getItemCount ( self ) > 0 ) { _cleanAndStore ( self , key , value ) ; } else { reject ( "Cache Manager LRUPersistentCache: cleanAndStore: even when the cache is empty, the new item with key [" + key + "] cannot be added" ) ; } } else { reject ( "Cache Manager LRUPersistentCache: cleanAndStore: cannot free space: " + collectErrorData ( event ) ) ; } } ) ; } , reject ) ; } } ) ; }
Tries to free space until the given new item is successfully added.
Tries to free space until the given new item is successfully added .