This commit is contained in:
Quan HL
2024-04-30 15:45:26 +07:00
parent 68a7f2b0d4
commit 6144a9c164

View File

@@ -4,8 +4,7 @@ const debug = require('debug')('jambonz:speech-utils');
const EXPIRY = 3600;
async function getAwsAuthToken(
logger,
createHash, retrieveHash,
logger, createHash, retrieveHash,
awsAccessKeyId, awsSecretAccessKey, awsRegion, roleArn = null) {
logger = logger || noopLogger;
try {
@@ -40,7 +39,6 @@ async function getAwsAuthToken(
sessionToken: data.Credentials.SessionToken
};
console.log(credentials, 'xquanluu');
/* expire 10 minutes before the hour, so we don't lose the use of it during a call */
createHash(key, credentials, EXPIRY - 600)
.catch((err) => logger.error(err, `Error saving hash for key ${key}`));