Skip to content

Commit

Permalink
Added default workers for loading deletion events (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
radovan-jorgic authored Dec 15, 2024
1 parent 6d30a39 commit aada8f9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Release Notes

#### v1.1.1

- Added default workers for loading deletion events.

#### v1.1.0

- Support for sync from DevRev to external system. Known limitations: no support for loading attachments.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devrev/ts-adaas",
"version": "1.1.0",
"version": "1.1.1",
"description": "Typescript library containing the ADaaS(AirDrop as a Service) control protocol.",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
14 changes: 14 additions & 0 deletions src/workers/default-workers/loader-state-deletion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { processTask, LoaderEventType } from '../../index';

processTask({
task: async ({ adapter }) => {
await adapter.emit(LoaderEventType.LoaderStateDeletionDone);
},
onTimeout: async ({ adapter }) => {
await adapter.emit(LoaderEventType.LoaderStateDeletionError, {
error: {
message: 'Failed to delete data. Lambda timeout.',
},
});
},
});
3 changes: 3 additions & 0 deletions src/workers/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ function getWorkerPath({
case EventType.ContinueLoadingData:
path = __dirname + '/default-workers/data-loading';
break;
case EventType.StartDeletingLoaderState:
path = __dirname + '/default-workers/loader-state-deletion';
break;

default:
emit({
Expand Down

0 comments on commit aada8f9

Please sign in to comment.