mirror of
https://github.com/rclone/rclone.git
synced 2025-02-23 15:33:08 +08:00
b2: fix "fatal error: concurrent map writes" - fixes #8355
This was caused by the embryonic metadata support. Since this isn't actually visible externally, this patch removes it for the time being.
This commit is contained in:
parent
0ef495fa76
commit
3daf62cf3d
@ -300,14 +300,13 @@ type Fs struct {
|
|||||||
|
|
||||||
// Object describes a b2 object
|
// Object describes a b2 object
|
||||||
type Object struct {
|
type Object struct {
|
||||||
fs *Fs // what this object is part of
|
fs *Fs // what this object is part of
|
||||||
remote string // The remote path
|
remote string // The remote path
|
||||||
id string // b2 id of the file
|
id string // b2 id of the file
|
||||||
modTime time.Time // The modified time of the object if known
|
modTime time.Time // The modified time of the object if known
|
||||||
sha1 string // SHA-1 hash if known
|
sha1 string // SHA-1 hash if known
|
||||||
size int64 // Size of the object
|
size int64 // Size of the object
|
||||||
mimeType string // Content-Type of the object
|
mimeType string // Content-Type of the object
|
||||||
meta map[string]string // The object metadata if known - may be nil - with lower case keys
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
@ -1605,9 +1604,6 @@ func (o *Object) decodeMetaDataRaw(ID, SHA1 string, Size int64, UploadTimestamp
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// For now, just set "mtime" in metadata
|
|
||||||
o.meta = make(map[string]string, 1)
|
|
||||||
o.meta["mtime"] = o.modTime.Format(time.RFC3339Nano)
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1887,13 +1883,6 @@ func (o *Object) getOrHead(ctx context.Context, method string, options []fs.Open
|
|||||||
Info: Info,
|
Info: Info,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Embryonic metadata support - just mtime
|
|
||||||
o.meta = make(map[string]string, 1)
|
|
||||||
modTime, err := parseTimeStringHelper(info.Info[timeKey])
|
|
||||||
if err == nil {
|
|
||||||
o.meta["mtime"] = modTime.Format(time.RFC3339Nano)
|
|
||||||
}
|
|
||||||
|
|
||||||
// When reading files from B2 via cloudflare using
|
// When reading files from B2 via cloudflare using
|
||||||
// --b2-download-url cloudflare strips the Content-Length
|
// --b2-download-url cloudflare strips the Content-Length
|
||||||
// headers (presumably so it can inject stuff) so use the old
|
// headers (presumably so it can inject stuff) so use the old
|
||||||
|
@ -258,12 +258,6 @@ func (f *Fs) internalTestMetadata(t *testing.T, size string, uploadCutoff string
|
|||||||
assert.Equal(t, v, got, k)
|
assert.Equal(t, v, got, k)
|
||||||
}
|
}
|
||||||
|
|
||||||
// mtime
|
|
||||||
for k, v := range metadata {
|
|
||||||
got := o.meta[k]
|
|
||||||
assert.Equal(t, v, got, k)
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.Equal(t, mimeType, gotMetadata.ContentType, "Content-Type")
|
assert.Equal(t, mimeType, gotMetadata.ContentType, "Content-Type")
|
||||||
|
|
||||||
// Modification time from the x-bz-info-src_last_modified_millis header
|
// Modification time from the x-bz-info-src_last_modified_millis header
|
||||||
|
Loading…
x
Reference in New Issue
Block a user