File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -485,18 +485,20 @@ void PostgreSQL::initializeMembers(PGconn *conn)
485
485
deletes.insert (key);
486
486
}
487
487
488
- if (_rc->clusterMode ) {
489
- auto tx = _cluster->transaction (_myAddressStr, true );
490
- for (std::string k : deletes) {
491
- tx.del (k);
492
- }
493
- tx.exec ();
494
- } else {
495
- auto tx = _redis->transaction (true );
496
- for (std::string k : deletes) {
497
- tx.del (k);
488
+ if (!deletes.empty ()) {
489
+ if (_rc->clusterMode ) {
490
+ auto tx = _cluster->transaction (_myAddressStr, true );
491
+ for (std::string k : deletes) {
492
+ tx.del (k);
493
+ }
494
+ tx.exec ();
495
+ } else {
496
+ auto tx = _redis->transaction (true );
497
+ for (std::string k : deletes) {
498
+ tx.del (k);
499
+ }
500
+ tx.exec ();
498
501
}
499
- tx.exec ();
500
502
}
501
503
}
502
504
You can’t perform that action at this time.
0 commit comments