Browse Source

Merge pull request 'returning after context is done' (#5) from wpr-649-fix-vfs into main

Reviewed-on: http://git.edtech.vm.prod-6.cloud.el/fabric/lib/pulls/5
main v0.3.41
lovetsky 2 weeks ago
parent
commit
ba366e5d19
  1. 14
      vfs.go

14
vfs.go

@ -150,7 +150,12 @@ func (v *vfs) Read(ctx context.Context, file string) (data []byte, mimeType stri
}
go func() {
chResult <- exec(ctx, file)
select {
case chResult <- exec(ctx, file):
return
case <-ctx.Done():
return
}
}()
select {
@ -203,7 +208,12 @@ func (v *vfs) ReadFromBucket(ctx context.Context, file, bucket string) (data []b
}
go func() {
chResult <- exec(ctx, file)
select {
case chResult <- exec(ctx, file):
return
case <-ctx.Done():
return
}
}()
select {

Loading…
Cancel
Save