Compare commits
2 Commits
v0.9.3
...
feature/ch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2c954136d | ||
|
|
5820583609 |
2
.github/workflows/coverage.yml
vendored
2
.github/workflows/coverage.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
- name: Collect Code Coverage
|
||||
run: |
|
||||
LINE_PCT=$(npm run test:coverage | tail -2 | head -1 | awk '{print $3}')
|
||||
LINE_PCT=$(npm run coverage | tail -2 | head -1 | awk '{print $3}')
|
||||
echo "COVERAGE=$LINE_PCT" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload Code Coverage
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -47,4 +47,4 @@ jobs:
|
||||
|
||||
- name: Test Application
|
||||
run: |
|
||||
npm run test:run
|
||||
npm run tests
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"main": "build/index.js",
|
||||
"exports": "./build/index.js",
|
||||
"scripts": {
|
||||
"test:run": "vitest run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"tests": "vitest run",
|
||||
"coverage": "vitest run --coverage",
|
||||
"watch": "tsx watch src",
|
||||
"build": "tsc",
|
||||
"prod": "node .",
|
||||
|
||||
@@ -33,12 +33,15 @@ const messageHistory: Queue<UserMessage> = new Queue<UserMessage>
|
||||
registerEvents(client, Events, messageHistory, ollama, Keys.defaultModel)
|
||||
|
||||
// Try to connect to redis
|
||||
await redis.connect()
|
||||
.then(() => console.log('[Redis] Connected'))
|
||||
.catch((error) => {
|
||||
console.error('[Redis] Connection Error', error)
|
||||
process.exit(1)
|
||||
})
|
||||
try {
|
||||
await redis.connect()
|
||||
console.log('[Redis] Successfully Connected')
|
||||
} catch(error) {
|
||||
console.error('[Redis] Connection Error. See error below:\n', error)
|
||||
console.warn('[Redis] Failed to connect to Redis Database, using local system')
|
||||
// TODO: create boolean flag that will probably be used in messageCreate.ts if redis database is down
|
||||
// When implementing this boolean flag, move connection to database BEFORE the registerEvents method
|
||||
}
|
||||
|
||||
// Try to log in the client
|
||||
await client.login(Keys.clientToken)
|
||||
|
||||
Reference in New Issue
Block a user