Ejemplo n.º 1
0
func NewBlockStorage(options *BlockStorageOptions) *BlockStorage {
	return &BlockStorage{
		BlockStorageOptions: options,
		FDLocks:             concurrency.NewLocks(context.Background(), options.MaxFiles, time.Minute*5),
		BatchPool:           concurrency.NewPool(options.PoolSize),
	}
}
Ejemplo n.º 2
0
func New(wd string, useGit bool, chunkSize int64, pool int) (res *Model, err error) {
	res = &Model{
		WD:        wd,
		BatchPool: concurrency.NewPool(pool * 32),
		chunkSize: chunkSize,
		FdLocks:   concurrency.NewLocks(context.Background(), pool, time.Minute*5),
	}
	if useGit {
		res.Git, err = git.NewGit(wd)
	}
	return
}