예제 #1
0
파일: block.go 프로젝트: pombredanne/bar
func NewBlockStorage(options *BlockStorageOptions) *BlockStorage {
	return &BlockStorage{
		BlockStorageOptions: options,
		FDLocks:             concurrency.NewLocks(context.Background(), options.MaxFiles, time.Minute*5),
		BatchPool:           concurrency.NewPool(options.PoolSize),
	}
}
예제 #2
0
파일: model.go 프로젝트: pombredanne/bar
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
}