Skip to content

Commit 23cd8db

Browse files
committed
Initialize lastFlushedHeartbeatBuffer to current time instead of zero
1 parent 7b1943c commit 23cd8db

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/wakatime.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class WakaTime {
2929
private disposable: vscode.Disposable;
3030
private lastFile: string;
3131
private lastHeartbeat: number = 0;
32-
private lastFlushedHeartbeatBuffer: number = 0;
32+
private lastFlushedHeartbeatBuffer: number = Date.now();
3333
private lastDebug: boolean = false;
3434
private lastCompile: boolean = false;
3535
private lastAICodeGenerating: boolean = false;
@@ -740,10 +740,7 @@ export class WakaTime {
740740
args.push('--time', String(heartbeat.time));
741741

742742
args.push('--sync-ai-disabled');
743-
744-
if (this.lastFlushedHeartbeatBuffer) {
745-
args.push('--sync-ai-after', String(this.lastFlushedHeartbeatBuffer));
746-
}
743+
args.push('--sync-ai-after', String(this.lastFlushedHeartbeatBuffer));
747744

748745
if (heartbeat.plugin) {
749746
args.push('--plugin', Utils.quote(heartbeat.plugin));

0 commit comments

Comments
 (0)