Call sentinelResetMaster() on every master with a name matching the specified * pattern. */
| 1602 | /* Call sentinelResetMaster() on every master with a name matching the specified |
| 1603 | * pattern. */ |
| 1604 | int sentinelResetMastersByPattern(char *pattern, int flags) { |
| 1605 | dictIterator *di; |
| 1606 | dictEntry *de; |
| 1607 | int reset = 0; |
| 1608 | |
| 1609 | di = dictGetIterator(sentinel.masters); |
| 1610 | while((de = dictNext(di)) != NULL) { |
| 1611 | sentinelRedisInstance *ri = (sentinelRedisInstance*)dictGetVal(de); |
| 1612 | |
| 1613 | if (ri->name) { |
| 1614 | if (stringmatch(pattern,ri->name,0)) { |
| 1615 | sentinelResetMaster(ri,flags); |
| 1616 | reset++; |
| 1617 | } |
| 1618 | } |
| 1619 | } |
| 1620 | dictReleaseIterator(di); |
| 1621 | return reset; |
| 1622 | } |
| 1623 | |
| 1624 | /* Reset the specified master with sentinelResetMaster(), and also change |
| 1625 | * the ip:port address, but take the name of the instance unmodified. |
no test coverage detected