Skip to content

Added default workers for loading deletion events #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading