mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-06-03 06:01:30 +08:00
third
This commit is contained in:
parent
23daab441c
commit
9b89b5c782
@ -122,10 +122,11 @@ func (c *s3Database) ApplyPut(ctx context.Context, req *third.ApplyPutReq) (*thi
|
|||||||
}
|
}
|
||||||
if hash, err := c.hash.Take(ctx, req.Hash, c.obj.Name()); err == nil {
|
if hash, err := c.hash.Take(ctx, req.Hash, c.obj.Name()); err == nil {
|
||||||
o := relation.ObjectInfoModel{
|
o := relation.ObjectInfoModel{
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
Hash: hash.Hash,
|
Hash: hash.Hash,
|
||||||
ValidTime: expirationTime,
|
ValidTime: expirationTime,
|
||||||
CreateTime: time.Now(),
|
ContentType: req.ContentType,
|
||||||
|
CreateTime: time.Now(),
|
||||||
}
|
}
|
||||||
if err := c.info.SetObject(ctx, &o); err != nil {
|
if err := c.info.SetObject(ctx, &o); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -240,10 +241,11 @@ func (c *s3Database) ConfirmPut(ctx context.Context, req *third.ConfirmPutReq) (
|
|||||||
}
|
}
|
||||||
if hash, err := c.hash.Take(ctx, put.Hash, c.obj.Name()); err == nil {
|
if hash, err := c.hash.Take(ctx, put.Hash, c.obj.Name()); err == nil {
|
||||||
o := relation.ObjectInfoModel{
|
o := relation.ObjectInfoModel{
|
||||||
Name: put.Name,
|
Name: put.Name,
|
||||||
Hash: hash.Hash,
|
Hash: hash.Hash,
|
||||||
ValidTime: put.ValidTime,
|
ValidTime: put.ValidTime,
|
||||||
CreateTime: time.Now(),
|
ContentType: put.ContentType,
|
||||||
|
CreateTime: time.Now(),
|
||||||
}
|
}
|
||||||
if err := c.info.SetObject(ctx, &o); err != nil {
|
if err := c.info.SetObject(ctx, &o); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user