chore: clean
This commit is contained in:
parent
16332cbb76
commit
7a816c867e
1 changed files with 0 additions and 5 deletions
5
index.js
5
index.js
|
@ -224,7 +224,6 @@ const HeadlessTask = async (event) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Change pace to ensure location updates with timeout
|
// Change pace to ensure location updates with timeout
|
||||||
const paceStartTime = Date.now();
|
|
||||||
await Promise.race([
|
await Promise.race([
|
||||||
BackgroundGeolocation.changePace(true),
|
BackgroundGeolocation.changePace(true),
|
||||||
new Promise((_, reject) =>
|
new Promise((_, reject) =>
|
||||||
|
@ -234,24 +233,20 @@ const HeadlessTask = async (event) => {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
const paceDuration = Date.now() - paceStartTime;
|
|
||||||
|
|
||||||
Sentry.addBreadcrumb({
|
Sentry.addBreadcrumb({
|
||||||
message: "changePace completed",
|
message: "changePace completed",
|
||||||
category: "headless-task",
|
category: "headless-task",
|
||||||
level: "info",
|
level: "info",
|
||||||
data: { duration: paceDuration },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Perform sync with timeout
|
// Perform sync with timeout
|
||||||
const syncStartTime = Date.now();
|
|
||||||
const syncResult = await Promise.race([
|
const syncResult = await Promise.race([
|
||||||
BackgroundGeolocation.sync(),
|
BackgroundGeolocation.sync(),
|
||||||
new Promise((_, reject) =>
|
new Promise((_, reject) =>
|
||||||
setTimeout(() => reject(new Error("sync timeout")), 20000),
|
setTimeout(() => reject(new Error("sync timeout")), 20000),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
const syncDuration = Date.now() - syncStartTime;
|
|
||||||
|
|
||||||
Sentry.addBreadcrumb({
|
Sentry.addBreadcrumb({
|
||||||
message: "Sync completed successfully",
|
message: "Sync completed successfully",
|
||||||
|
|
Loading…
Add table
Reference in a new issue