1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00

Refactor purgeDocument calls to deleteCachedDocument

This commit is contained in:
kodumbeats 2021-10-05 09:05:40 -04:00
parent 22132ef420
commit 481ff1e2f9
2 changed files with 8 additions and 8 deletions

View file

@ -96,7 +96,7 @@ function createAttribute($collectionId, $attribute, $response, $dbForInternal, $
throw new Exception('Attribute already exists', 409);
}
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
// Pass clone of $attribute object to workers
// so we can later modify Document to fit response model
@ -1131,7 +1131,7 @@ App::delete('/v1/database/collections/:collectionId/attributes/:attributeId')
}
$attribute = $dbForInternal->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'deleting'));
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
$database
->setParam('type', DATABASE_TYPE_DELETE_ATTRIBUTE)
@ -1238,7 +1238,7 @@ App::post('/v1/database/collections/:collectionId/indexes')
throw new Exception('Index already exists', 409);
}
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
$database
->setParam('type', DATABASE_TYPE_CREATE_INDEX)
@ -1383,7 +1383,7 @@ App::delete('/v1/database/collections/:collectionId/indexes/:indexId')
}
$index = $dbForInternal->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'deleting'));
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
$database
->setParam('type', DATABASE_TYPE_DELETE_INDEX)

View file

@ -94,7 +94,7 @@ class DatabaseV1 extends Worker
$dbForInternal->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'failed'));
}
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
}
/**
@ -120,7 +120,7 @@ class DatabaseV1 extends Worker
$dbForInternal->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'failed'));
}
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
}
/**
@ -150,7 +150,7 @@ class DatabaseV1 extends Worker
$dbForInternal->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'failed'));
}
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
}
/**
@ -177,6 +177,6 @@ class DatabaseV1 extends Worker
$dbForInternal->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'failed'));
}
$dbForInternal->purgeDocument('collections', $collectionId);
$dbForInternal->deleteCachedDocument('collections', $collectionId);
}
}