sujoydev99 commited on
Commit
5906edb
·
1 Parent(s): c266adc

redis added

Browse files
Files changed (6) hide show
  1. api.js +6 -1
  2. api/index.js +6 -1
  3. cache.js +6 -1
  4. functions.js +6 -1
  5. index.js +6 -1
  6. utils.js +6 -1
api.js CHANGED
@@ -25,7 +25,12 @@ import OpenAI from 'openai';
25
  import compression from 'compression';
26
  import cookieParser from 'cookie-parser';
27
  const listCache = new RedisListCache({ namespace: "fc" })
28
- const redis = new Redis();
 
 
 
 
 
29
  const skills = {
30
  getApplications,
31
  createApplication,
 
25
  import compression from 'compression';
26
  import cookieParser from 'cookie-parser';
27
  const listCache = new RedisListCache({ namespace: "fc" })
28
+ const redis = new Redis({
29
+ host: 'redis-12291.c305.ap-south-1-1.ec2.cloud.redislabs.com',
30
+ port: 12291,
31
+ password: 'KQCVapXXF2ioM4zF5krQFImzAYkKWY5l',
32
+ username: "default"
33
+ });
34
  const skills = {
35
  getApplications,
36
  createApplication,
api/index.js CHANGED
@@ -7,7 +7,12 @@ import yaml from 'js-yaml'
7
  import fs from 'fs';
8
  import { RedisListCache } from './cache.js';
9
  const listCache = new RedisListCache({ namespace: "fc" })
10
- const redis = new Redis();
 
 
 
 
 
11
 
12
  const app = express();
13
  const port = process.env.PORT;
 
7
  import fs from 'fs';
8
  import { RedisListCache } from './cache.js';
9
  const listCache = new RedisListCache({ namespace: "fc" })
10
+ const redis = new Redis({
11
+ host: 'redis-12291.c305.ap-south-1-1.ec2.cloud.redislabs.com',
12
+ port: 12291,
13
+ password: 'KQCVapXXF2ioM4zF5krQFImzAYkKWY5l',
14
+ username: "default"
15
+ });
16
 
17
  const app = express();
18
  const port = process.env.PORT;
cache.js CHANGED
@@ -7,7 +7,12 @@ import { Redis } from 'ioredis';
7
 
8
  export class RedisListCache {
9
  constructor(params = {}) {
10
- this.redis = new Redis()
 
 
 
 
 
11
  this.namespace = params.namespace ? params.namespace + ':' : '';
12
  }
13
 
 
7
 
8
  export class RedisListCache {
9
  constructor(params = {}) {
10
+ this.redis = new Redis({
11
+ host: 'redis-12291.c305.ap-south-1-1.ec2.cloud.redislabs.com',
12
+ port: 12291,
13
+ password: 'KQCVapXXF2ioM4zF5krQFImzAYkKWY5l',
14
+ username: "default"
15
+ })
16
  this.namespace = params.namespace ? params.namespace + ':' : '';
17
  }
18
 
functions.js CHANGED
@@ -1,7 +1,12 @@
1
  import Redis from "ioredis";
2
  import { initClient } from './utils.js';
3
 
4
- const redis = new Redis();
 
 
 
 
 
5
 
6
 
7
 
 
1
  import Redis from "ioredis";
2
  import { initClient } from './utils.js';
3
 
4
+ const redis = new Redis({
5
+ host: 'redis-12291.c305.ap-south-1-1.ec2.cloud.redislabs.com',
6
+ port: 12291,
7
+ password: 'KQCVapXXF2ioM4zF5krQFImzAYkKWY5l',
8
+ username: "default" // Replace with your Redis instance's password
9
+ });
10
 
11
 
12
 
index.js CHANGED
@@ -24,7 +24,12 @@ import OpenAI from 'openai';
24
  import compression from 'compression';
25
  import cookieParser from 'cookie-parser';
26
  const listCache = new RedisListCache({ namespace: "fc" })
27
- const redis = new Redis();
 
 
 
 
 
28
  const skills = {
29
  getApplications,
30
  createApplication,
 
24
  import compression from 'compression';
25
  import cookieParser from 'cookie-parser';
26
  const listCache = new RedisListCache({ namespace: "fc" })
27
+ const redis = new Redis({
28
+ host: 'redis-12291.c305.ap-south-1-1.ec2.cloud.redislabs.com',
29
+ port: 12291,
30
+ password: 'KQCVapXXF2ioM4zF5krQFImzAYkKWY5l',
31
+ username: "default" // Replace with your Redis instance's password
32
+ });
33
  const skills = {
34
  getApplications,
35
  createApplication,
utils.js CHANGED
@@ -1,6 +1,11 @@
1
  import { PlatformClient, PlatformConfig } from "@gofynd/fdk-client-javascript";
2
  import Redis from "ioredis"
3
- const redis = new Redis();
 
 
 
 
 
4
 
5
  export const initClient = async (companyId) => {
6
  let creds = await redis.get(`${companyId}:creds`);
 
1
  import { PlatformClient, PlatformConfig } from "@gofynd/fdk-client-javascript";
2
  import Redis from "ioredis"
3
+ const redis = new Redis({
4
+ host: 'redis-12291.c305.ap-south-1-1.ec2.cloud.redislabs.com',
5
+ port: 12291,
6
+ password: 'KQCVapXXF2ioM4zF5krQFImzAYkKWY5l',
7
+ username: "default"
8
+ });
9
 
10
  export const initClient = async (companyId) => {
11
  let creds = await redis.get(`${companyId}:creds`);