MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / task

Function task

packages/queue/src/tasks/remove-community.ts:16–37  ·  view source on GitHub ↗
(logger: Logger, payload: { accountId: string })

Source from the content-addressed store, hash-verified

14};
15
16async function task(logger: Logger, payload: { accountId: string }) {
17 logger.info(payload);
18
19 const account = await AccountsService.getMoreInfo(payload.accountId);
20 const moreInfo = JSON.stringify(account);
21
22 await sendNotification(
23 `[INFO] Remove account ${payload.accountId} process started: ${moreInfo}`
24 );
25 try {
26 await cleanUp({ accountId: payload.accountId, logger });
27 await sendNotification(
28 `[INFO] Remove account ${payload.accountId} process finished: ${moreInfo}`
29 );
30 } catch (error) {
31 await sendNotification(
32 `[ERROR] Remove account ${payload.accountId} process failed: ${moreInfo}`
33 );
34 logger.error({ error });
35 throw error;
36 }
37}
38
39async function cleanUp({
40 accountId,

Callers 1

removeCommunityFunction · 0.70

Calls 5

sendNotificationFunction · 0.90
getMoreInfoMethod · 0.80
cleanUpFunction · 0.70
infoMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected