Consume kinesis logs while task is RUNNING status
parent
6f6177a915
commit
07051a9c9a
File diff suppressed because one or more lines are too long
|
|
@ -123,19 +123,23 @@ class AWS {
|
|||
})
|
||||
.promise();
|
||||
|
||||
while ((await getTaskStatus()) === 'RUNNING') {
|
||||
const iterator = await kinesis
|
||||
let iterator = (
|
||||
await kinesis
|
||||
.getShardIterator({
|
||||
ShardIteratorType: 'TRIM_HORIZON',
|
||||
StreamName: stream.StreamDescription.StreamName,
|
||||
ShardId: stream.StreamDescription.Shards[0].ShardId,
|
||||
})
|
||||
.promise();
|
||||
.promise()
|
||||
).ShardIterator;
|
||||
|
||||
while ((await getTaskStatus()) === 'RUNNING') {
|
||||
const records = await kinesis
|
||||
.getRecords({
|
||||
ShardIterator: iterator.ShardIterator,
|
||||
})
|
||||
.promise();
|
||||
iterator = records.NextShardIterator;
|
||||
core.info(Buffer.from(records.Records[0].Data).toString('base64'));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue