mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 18:13:29 -08:00
[Server+Client] Tombstone deck deletes with purge and base snapshots
This commit is contained in:
parent
2916fa45af
commit
e43862c3bc
8 changed files with 180 additions and 21 deletions
|
|
@ -622,6 +622,7 @@ bool Servatrice::initServer()
|
|||
|
||||
deckShareCleanupClock = new QTimer(this);
|
||||
connect(deckShareCleanupClock, SIGNAL(timeout()), this, SLOT(cleanupExpiredDeckShares()));
|
||||
connect(deckShareCleanupClock, SIGNAL(timeout()), this, SLOT(purgeDeckTombstones()));
|
||||
const int deckShareCleanupInterval = getDeckShareCleanupInterval();
|
||||
if (deckShareCleanupInterval > 0) {
|
||||
qDebug() << "Starting deck share cleanup clock, interval" << deckShareCleanupInterval << "ms";
|
||||
|
|
@ -856,6 +857,11 @@ void Servatrice::cleanupExpiredDeckShares()
|
|||
servatriceDatabaseInterface->cleanupExpiredDeckShares();
|
||||
}
|
||||
|
||||
void Servatrice::purgeDeckTombstones()
|
||||
{
|
||||
servatriceDatabaseInterface->purgeDeckTombstones(getDeckSyncTombstoneDays());
|
||||
}
|
||||
|
||||
void Servatrice::statusUpdate()
|
||||
{
|
||||
if (!servatriceDatabaseInterface->checkSql()) {
|
||||
|
|
@ -1401,6 +1407,11 @@ int Servatrice::getDeckSyncMaxVersions() const
|
|||
return qMax(1, settingsCache->value("deck_sync/max_versions", 20).toInt());
|
||||
}
|
||||
|
||||
int Servatrice::getDeckSyncTombstoneDays() const
|
||||
{
|
||||
return qMax(0, settingsCache->value("deck_sync/tombstone_days", 30).toInt());
|
||||
}
|
||||
|
||||
int Servatrice::getNumberOfTCPPools() const
|
||||
{
|
||||
return settingsCache->value("server/number_pools", 1).toInt();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue