Skip to content

Commit 84e7072

Browse files
committed
rename function
1 parent b040eb1 commit 84e7072

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎packages/vue/src/tracing.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,22 @@ function maybeEndRootComponentSpan(vm: VueSentry, timestamp: number, timeout: nu
7171
root.$_sentryRootComponentSpanActivity = timestamp;
7272

7373
if (!root.$_sentryRootComponentSpanTimer) {
74-
armRootComponentSpanTimer(root, timestamp, timeout);
74+
scheduleRootComponentSpanEnd(root, timestamp, timeout);
7575
}
7676
}
7777

7878
/**
7979
* Fires `delayMs` after the activity that scheduled it. Activity recorded in the meantime pushes
8080
* the deadline out by the recorded gap, so the span always ends at the last activity timestamp.
8181
*/
82-
function armRootComponentSpanTimer(root: VueSentry, armedFor: number, delayMs: number): void {
82+
function scheduleRootComponentSpanEnd(root: VueSentry, activityWhenScheduled: number, delayMs: number): void {
8383
root.$_sentryRootComponentSpanTimer = setTimeout(() => {
8484
root.$_sentryRootComponentSpanTimer = undefined;
8585

86-
const lastActivity = root.$_sentryRootComponentSpanActivity ?? armedFor;
87-
if (lastActivity > armedFor) {
88-
armRootComponentSpanTimer(root, lastActivity, (lastActivity - armedFor) * 1000);
86+
const lastActivity = root.$_sentryRootComponentSpanActivity ?? activityWhenScheduled;
87+
if (lastActivity > activityWhenScheduled) {
88+
// activity happened after this timer was scheduled: push the deadline out
89+
scheduleRootComponentSpanEnd(root, lastActivity, (lastActivity - activityWhenScheduled) * 1000);
8990
return;
9091
}
9192

0 commit comments

Comments
 (0)