Skip to content

Conversation

@codeDude64
Copy link
Contributor

Closes #13

##Proposal

  • Remove the ioredis lib
  • Add the node-redis lib
  • Adapt the average javascript file to use the new library
  • Format the code.

My discords account is codeDude#4396

@SuzeShardlow
Copy link
Contributor

Thanks for the PR, @codeDude64 - we''ll take a look :)

Copy link

@simonprickett simonprickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good and works locally when tested - I left one suggestion to retain the capability to connect to Redis at a configurable host/port/user/password... please take a look at that then we should be good to go. Thanks!

const db = new Database(constants.sqlite_database)
const redis = new Redis(constants.redis)
const db = new Database(constants.sqlite_database);
const client = createClient();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codeDude64 this will always assume Redis is on localhost:6379 with no password. The previous ioredis code used the object redis in constants.js to specify where Redis is when connecting to it... please change this code here to:

const client = createClient({ url: constants.redis });

then update constants.redis so that the value of redis is a Redis URL, for example redis://localhost:6379 - this will allow people to configure where Redis is and optionally a username and password if needed in one line. See https://github.com/redis/node-redis/blob/master/docs/client-configuration.md for details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codeDude64 this will always assume Redis is on localhost:6379 with no password. The previous ioredis code used the object redis in constants.js to specify where Redis is when connecting to it... please change this code here to:

const client = createClient({ url: constants.redis });

then update constants.redis so that the value of redis is a Redis URL, for example redis://localhost:6379 - this will allow people to configure where Redis is and optionally a username and password if needed in one line. See https://github.com/redis/node-redis/blob/master/docs/client-configuration.md for details.

Just to confirm the username and the password are optional in the Redis URL, right?

@codeDude64 codeDude64 requested review from simonprickett and removed request for SuzeShardlow October 11, 2022 16:56
@SuzeShardlow
Copy link
Contributor

@codeDude64 I am curious as to what's going on here... who is @SalvadorJJ? Because they seem to have made all the commits on your PR.

@codeDude64
Copy link
Contributor Author

@codeDude64 I am curious as to what's going on here... who is @SalvadorJJ? Because they seem to have made all the commits on your PR.

OMG So sorry for that. It's my another account. @SalvadorJJ It's the account that I use to work, I'm a software developer in a company, so I like to separate my personal projects with the work. I totally missed change the email in my local git configuration. I'll fix immediately

@codeDude64 codeDude64 force-pushed the feature/change-the-redis-nodejs-library branch from 1087205 to e12de25 Compare October 12, 2022 08:11
@codeDude64
Copy link
Contributor Author

@SuzeShardlow I just fixed it. I changed the commits metadata with my correct personal email and username.

Copy link

@simonprickett simonprickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - looks good @SuzeShardlow will merge.

@SuzeShardlow
Copy link
Contributor

@codeDude64 I am curious as to what's going on here... who is @SalvadorJJ? Because they seem to have made all the commits on your PR.

OMG So sorry for that. It's my another account. @SalvadorJJ It's the account that I use to work, I'm a software developer in a company, so I like to separate my personal projects with the work. I totally missed change the email in my local git configuration. I'll fix immediately

Thanks, no problem, I was just super confused and thought you were collaborating with someone else. You were collaborating with yourself! 😂

@SuzeShardlow SuzeShardlow merged commit 897d905 into redis-developer:main Oct 14, 2022
@SuzeShardlow SuzeShardlow added the hacktoberfest-accepted Hacktoberfest 2022 Accepted label Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Hacktoberfest 2022 Accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite the node.js code to use the node-redis client.

3 participants