Compare commits

...

2 Commits

2 changed files with 12 additions and 3 deletions

View File

@ -5,7 +5,8 @@ import rDramaSession from './rdrama/session/SessionManager';
import RedisSessionManager from './redis/session/SessionManager';
import { CommentProcessor } from './rdrama/services/CommentProcessor';
const workflowInterval = 60000; // Run every 60,000 milliseconds (1 minute)
// Run every 300,000 milliseconds (5 minutes) by default
const workflowInterval = 1000 * 60 * Number(process.env.POLLING_FREQUENCY || 5);
async function startApplication() {
console.log('Redis Start');
@ -18,7 +19,15 @@ async function startApplication() {
}
rDramaSessionManager.setAuthorizationToken(process.env.RDRAMA_API_KEY);
// Initialize and start your workflow
// Initialize and start workflow
try {
await CommentProcessor.processComments();
console.log('Workflow executed successfully.');
} catch (error) {
console.error('An error occurred during workflow execution:', error);
}
// Schedule future runs
setInterval(async () => {
try {
await CommentProcessor.processComments();

View File

@ -40,7 +40,7 @@ class SessionManager {
this.wrapAxiosInstance(this.axiosInstance);
axiosRetry(this.axiosInstance, {
retries: 3,
retries: 10,
retryDelay: this.retryDelayStrategy,
retryCondition: this.retryCondition,
});