Added read status to obj

Signed-off-by: m.malygina <m.malygina@yadro.com>
This commit is contained in:
m.malygina 2024-06-05 16:49:45 +03:00
parent 12711422ab
commit 645e53dd16

View file

@ -181,15 +181,16 @@ export function obj_read() {
if (obj_to_read_selector) {
const obj = obj_to_read_selector.nextObject();
if (!obj) {
if (!obj || (obj.status == "read") ) {
return;
}
const resp = s3_client.get(obj.s3_bucket, obj.s3_key)
if (!resp.success) {
log.withFields({bucket : obj.s3_bucket, key : obj.s3_key})
.error(resp.error);
} else {
obj_registry.setObjectStatus(obj.id, obj.status, "read");
}
obj_registry.setObjectStatus(obj.id, obj.status, "read");
return
}