Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin Schaffer <austin.schaffer@ryansg.com>2019-11-13 14:08:42 -0500
committerAustin Schaffer <austin.schaffer@ryansg.com>2019-11-20 09:48:28 -0500
commit9b5cd4e89f8d8778994a01eca641d4b78296c4d9 (patch)
tree536a3aeed86a285daed32a818e0d1afee57ecd29 /src/system/db/DeltaDao.ts
parent309585cf6e02322dcd3f34cda2e719f480a29c72 (diff)
downloadliza-9b5cd4e89f8d8778994a01eca641d4b78296c4d9.tar.gz
liza-9b5cd4e89f8d8778994a01eca641d4b78296c4d9.tar.bz2
liza-9b5cd4e89f8d8778994a01eca641d4b78296c4d9.zip
[DEV-5312] Call data-processor and instantiate classes
Diffstat (limited to 'src/system/db/DeltaDao.ts')
-rw-r--r--src/system/db/DeltaDao.ts24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/system/db/DeltaDao.ts b/src/system/db/DeltaDao.ts
index 53cd8f5..64e1f0f 100644
--- a/src/system/db/DeltaDao.ts
+++ b/src/system/db/DeltaDao.ts
@@ -28,7 +28,6 @@
*/
import { DocumentId } from "../../document/Document";
-import { PositiveInteger } from "../../numeric";
/** Manage deltas */
@@ -39,23 +38,21 @@ export interface DeltaDao
*
* @return documents in need of processing
*/
- getUnprocessedDocuments(
- callback: ( data: Record<string, any>[] ) => void,
- ): this;
+ getUnprocessedDocuments(): Promise<Record<string, any>[]>
/**
* Set the document's processed index
*
- * @param doc_id - The document whose index will be set
- * @param index - The index to set
+ * @param doc_id - Document whose index will be set
+ * @param type - Delta type
+ *
+ * @return any errors that occured
*/
- advanceDeltaIndexByType(
+ advanceDeltaIndex(
doc_id: DocumentId,
type: string,
- index: PositiveInteger,
- callback: ( err: NullableError, indexHasAdvanced: boolean ) => void,
- ): this;
+ ): Promise<NullableError>
/**
@@ -68,9 +65,8 @@ export interface DeltaDao
* @return true if the document was successfully marked as processed
*/
markDocumentAsProcessed(
- doc_id: DocumentId,
- last_update_ts: UnixTimestamp,
- callback: ( err: NullableError, markedSuccessfully: boolean ) => void,
- ): this;
+ doc_id: DocumentId,
+ last_update_ts: UnixTimestamp,
+ ): Promise<NullableError>
}