mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-03 18:55:39 +00:00
fix make_bucket created not set
This commit is contained in:
@@ -287,8 +287,13 @@ impl BucketMetadata {
|
|||||||
Ok(updated)
|
Ok(updated)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_created(&mut self, created: OffsetDateTime) {
|
pub fn set_created(&mut self, created: Option<OffsetDateTime>) {
|
||||||
self.created = created
|
self.created = {
|
||||||
|
match created {
|
||||||
|
Some(t) => t,
|
||||||
|
None => OffsetDateTime::now_utc(),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn save(&mut self) -> Result<()> {
|
pub async fn save(&mut self) -> Result<()> {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ use tokio::select;
|
|||||||
use tokio::sync::mpsc::Sender;
|
use tokio::sync::mpsc::Sender;
|
||||||
use tokio::sync::{broadcast, mpsc, RwLock};
|
use tokio::sync::{broadcast, mpsc, RwLock};
|
||||||
use tokio::time::{interval, sleep};
|
use tokio::time::{interval, sleep};
|
||||||
use tracing::{debug, info};
|
use tracing::{debug, info, warn};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
const MAX_UPLOADS_LIST: usize = 10000;
|
const MAX_UPLOADS_LIST: usize = 10000;
|
||||||
@@ -1223,8 +1223,10 @@ impl StorageAPI for ECStore {
|
|||||||
let mut buckets = self.peer_sys.list_bucket(opts).await?;
|
let mut buckets = self.peer_sys.list_bucket(opts).await?;
|
||||||
|
|
||||||
if !opts.no_metadata {
|
if !opts.no_metadata {
|
||||||
|
warn!("list_bucket meta");
|
||||||
for bucket in buckets.iter_mut() {
|
for bucket in buckets.iter_mut() {
|
||||||
if let Ok(created) = metadata_sys::created_at(&bucket.name).await {
|
if let Ok(created) = metadata_sys::created_at(&bucket.name).await {
|
||||||
|
warn!("list_bucket created {:?}", &created);
|
||||||
bucket.created = Some(created);
|
bucket.created = Some(created);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1287,9 +1289,7 @@ impl StorageAPI for ECStore {
|
|||||||
|
|
||||||
let mut meta = BucketMetadata::new(bucket);
|
let mut meta = BucketMetadata::new(bucket);
|
||||||
|
|
||||||
if let Some(crd) = opts.created_at {
|
meta.set_created(opts.created_at);
|
||||||
meta.set_created(crd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if opts.lock_enabled {
|
if opts.lock_enabled {
|
||||||
meta.object_lock_config_xml = xml::serialize::<ObjectLockConfiguration>(&enableObjcetLockConfig)?;
|
meta.object_lock_config_xml = xml::serialize::<ObjectLockConfiguration>(&enableObjcetLockConfig)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user