Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add optional options param for RedisClient.putObject #391

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/redis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@walmartlabs/cookie-cutter-redis",
"version": "1.6.0-beta.1",
"version": "1.6.0-beta.2",
"license": "Apache-2.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 4 additions & 2 deletions packages/redis/src/RedisClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
RootNodesUnavailableError,
SocketClosedUnexpectedlyError,
WatchError,
SetOptions,
} from "redis";

import { isNullOrUndefined } from "util";
Expand Down Expand Up @@ -247,7 +248,8 @@ export class RedisClient implements IRedisClient, IRequireInitialization, IDispo
context: SpanContext,
type: string | IClassType<T>,
body: T,
key: string
key: string,
options?: SetOptions,
): Promise<void> {
const db = this.config.db;
const span = this.tracer.startSpan("Redis Client putObject Call", { childOf: context });
Expand All @@ -261,7 +263,7 @@ export class RedisClient implements IRedisClient, IRequireInitialization, IDispo
const buf = Buffer.from(encodedBody);
const storableValue = this.config.base64Encode ? buf.toString("base64") : buf;
try {
await this.client.set(key, storableValue);
await this.client.set(key, storableValue, options);
this.metrics.increment(RedisClientMetrics.Set, {
[MetricLabels.Type]: typeName,
db,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11615,4 +11615,4 @@ yauzl@^2.4.2:
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==