@sqrzro/server 2.0.0-bz.16 → 2.0.0-bz.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { createClient } from 'redis';
|
|
2
2
|
async function getClient() {
|
|
3
|
-
|
|
3
|
+
if (!process.env.REDIS_URL) {
|
|
4
|
+
throw new Error('REDIS_URL is not defined. Access to the cache is not possible.');
|
|
5
|
+
}
|
|
6
|
+
const client = createClient({
|
|
7
|
+
url: process.env.REDIS_URL,
|
|
8
|
+
});
|
|
4
9
|
await client.connect();
|
|
5
10
|
return client;
|
|
6
11
|
}
|