Skip to content

Commit

Permalink
CR changes
Browse files Browse the repository at this point in the history
Signed-off-by: shirady <[email protected]>
  • Loading branch information
shirady committed Nov 21, 2024
1 parent 2acef62 commit c446c18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/endpoint/s3/s3_bucket_logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ async function send_bucket_op_logs(req, res) {
//so we aggregate and issue the writes only in the end
const writes_aggregate = [];

let bucket_info; // please notice bucket_info might be undefined
let bucket_info;
try {
bucket_info = await req.object_sdk.read_bucket_sdk_config_info(req.params.bucket);
dbg.log2("read_bucket_sdk_config_info = ", bucket_info);
} catch (err) {
dbg.warn(`send_bucket_op_logs of bucket ${req.params.bucket} got an error:`, err);
return;
}

if (is_bucket_logging_enabled(bucket_info)) {
dbg.log2("Bucket logging is enabled for Bucket : ", req.params.bucket);
endpoint_bucket_op_logs(req.op_name, req, res, bucket_info, writes_aggregate);
}

if (req.notification_logger && bucket_info && bucket_info.notifications) {
if (req.notification_logger && bucket_info.notifications) {
for (const notif_conf of bucket_info.notifications) {
if (check_notif_relevant(notif_conf, req)) {
const notif = compose_notification_req(req, res, bucket_info, notif_conf);
Expand Down

0 comments on commit c446c18

Please sign in to comment.