MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / issueCommandRepeat

Function issueCommandRepeat

src/redis-cli.c:1866–1896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1864}
1865
1866static int issueCommandRepeat(int argc, char **argv, long repeat) {
1867 while (1) {
1868 if (config.cluster_reissue_command || context == NULL ||
1869 context->err == REDIS_ERR_IO || context->err == REDIS_ERR_EOF)
1870 {
1871 if (cliConnect(CC_FORCE) != REDIS_OK) {
1872 cliPrintContextError();
1873 config.cluster_reissue_command = 0;
1874 return REDIS_ERR;
1875 }
1876 }
1877 config.cluster_reissue_command = 0;
1878 if (config.cluster_send_asking) {
1879 if (cliSendAsking() != REDIS_OK) {
1880 cliPrintContextError();
1881 return REDIS_ERR;
1882 }
1883 }
1884 if (cliSendCommand(argc,argv,repeat) != REDIS_OK) {
1885 cliPrintContextError();
1886 return REDIS_ERR;
1887 }
1888
1889 /* Issue the command again if we got redirected in cluster mode */
1890 if (config.cluster_mode && config.cluster_reissue_command) {
1891 continue;
1892 }
1893 break;
1894 }
1895 return REDIS_OK;
1896}
1897
1898static int issueCommand(int argc, char **argv) {
1899 return issueCommandRepeat(argc, argv, config.repeat);

Callers 2

issueCommandFunction · 0.85
replFunction · 0.85

Calls 4

cliConnectFunction · 0.85
cliPrintContextErrorFunction · 0.85
cliSendAskingFunction · 0.85
cliSendCommandFunction · 0.85

Tested by

no test coverage detected