Skip to content

Commit

Permalink
delete
Browse files Browse the repository at this point in the history
  • Loading branch information
satackey committed Aug 5, 2020
1 parent d8194ff commit 11c7535
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/LayerCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ import { assertManifests, Manifest, Manifests } from './Tar'
import format from 'string-format'
import PromisePool from 'native-promise-pool'

type ReturnPromiseFunc = <T>(arg: any) => Promise<T[]>

const createPromiseProducerFromArray = <T, T2>(array: T[], callBackFunc: ((t: T) => Promise<T2>)) => {
const currentIndex = 0;

return () => callBackFunc(array[currentIndex])
}

const generatePromise = function * <T1, T2>(array: T1[], callbackFunc: ((t: T1) => Promise<T2>)) {
for (let i = 0; i < array.length; i++) {
yield callbackFunc(array[i])
}
}

class LayerCache {
// repotag: string
ids: string[]
Expand Down Expand Up @@ -198,10 +184,6 @@ class LayerCache {
}

private async restoreLayers() {
const restoring = (await this.getLayerIds()).map(layerId => this.restoreSingleLayerBy(layerId));

const promiseIter = generatePromise(await this.getLayerIds(), layerId => this.restoreSingleLayerBy(layerId))

const pool = new PromisePool(this.concurrency)

const restoredLayerKeysThatMayContainUndefined = await Promise.all(
Expand Down

0 comments on commit 11c7535

Please sign in to comment.