一次又一次,我们得到这个错误:
{ Error: Redis connection to some-redis-server:6379 failed - read ETIMEDOUT
at TCP.onStreamRead (internal/stream_base_commons.js:171:27) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'read' }
{ AbortError: Redis connection lost and command aborted. It might have been processed.
at RedisClient.flush_and_error (/usr/src/app/node_modules/redis/index.js:362:23)
at RedisClient.connection_gone (/usr/src/app/node_modules/redis/index.js:664:14)
at Socket.<anonymous> (/usr/src/app/node_modules/redis/index.js:289:14)
at Object.onceWrapper (events.js:281:20)
at Socket.emit (events.js:193:13)
at TCP._handle.close (net.js:614:12)
code: 'UNCERTAIN_STATE',
command: 'GET'
args: [ 'some-key' ] }
Run Code Online (Sandbox Code Playgroud)
我们使用https://www.npmjs.com/package/redis来访问 redis。设置的一些细节:
我不知道从哪里真正开始寻找,所以任何帮助将不胜感激。
//8.
//----------------------------------------------------------------
//-------- Display orignal and encrypted message information
//----------------------------------------------------------------
private void displayEncryptedMessage(String originalMessage, String encryptedMessage) {
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println("Enter Message to be encrypted: ");
System.out.println("");
System.out.println("");
System.out.println("");
System.out.println(" Plain Text : " + originalMessage);
}
// 9
//----------------------------------------------------------------
// Encrypted it by substituting the character with the corresponding character in the cipher.
//
//----------------------------------------------------------------
private void encrypt(String cipher){
int letterPosition;
String encryptedMessage = "";
String originalMessage = Keyboard.readInput();
displayEncryptedMessage(String originalMessage, String encryptedMessage);
for (letterPosition=0; letterPosition<originalMessage.length(); letterPosition++){
char replaceCipherLetter …Run Code Online (Sandbox Code Playgroud)