Compare commits
2 Commits
9863078fd9
...
657b11e36b
Author | SHA1 | Date |
---|---|---|
j | 657b11e36b | |
j | 3c117abbd3 |
13
src/index.ts
13
src/index.ts
|
@ -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();
|
||||
|
|
|
@ -40,7 +40,7 @@ class SessionManager {
|
|||
this.wrapAxiosInstance(this.axiosInstance);
|
||||
|
||||
axiosRetry(this.axiosInstance, {
|
||||
retries: 3,
|
||||
retries: 10,
|
||||
retryDelay: this.retryDelayStrategy,
|
||||
retryCondition: this.retryCondition,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue