Skip to content
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

Kate slowness with errors #21

Open
Mte90 opened this issue Jun 1, 2022 · 8 comments
Open

Kate slowness with errors #21

Mte90 opened this issue Jun 1, 2022 · 8 comments
Assignees
Labels

Comments

@Mte90
Copy link
Contributor

Mte90 commented Jun 1, 2022

So I was getting some slowness inside Kate, running with shell I am getting this errors.

wakatime: File path: "/home/mte90/Desktop/Prog/GameShell/missions/pipe_intro_book_of_potions/01_head/goal/en.txt"
wakatime: Single heartbeat in array: QJsonDocument({"category":"coding","entity":"HIDDEN.txt","language":"Normal","project":"01_head","time":1654088388,"type":"file"})
offlinequeue: connect(): Returning existing db instance
wakatime: File path: "/home/mte90/Desktop/Prog/GameShell/missions/pipe_intro_book_of_potions/01_head/goal/en.txt"
wakatime: Single heartbeat in array: QJsonDocument({"category":"coding","entity":"HIDDEN.txt","language":"Normal","project":"01_head","time":1654088388,"type":"file"})
offlinequeue: connect(): Returning existing db instance
wakatime: File path: "/home/mte90/Desktop/Prog/GameShell/missions/pipe_intro_book_of_potions/01_head/goal/en.txt"
wakatime: Single heartbeat in array: QJsonDocument({"category":"coding","entity":"HIDDEN.txt","language":"Normal","project":"01_head","time":1654088388,"type":"file"})
offlinequeue: connect(): Returning existing db instance
wakatime: Status code: 301
wakatime: Could not parse response. All responses are expected to be JSON serialised
wakatime: Status code: 301
wakatime: Could not parse response. All responses are expected to be JSON serialised
wakatime: Status code: 301
wakatime: Could not parse response. All responses are expected to be JSON serialised

The line

const QJsonDocument doc = QJsonDocument::fromJson(contents);

@Mte90
Copy link
Contributor Author

Mte90 commented Jun 1, 2022

This line require a change as this file was moved https://github.com/Tatsh/kate-wakatime/blob/master/wakatimeplugin.cpp#L36

#include <KF5/KTextEditor/ktexteditor_version.h>

@Mte90
Copy link
Contributor Author

Mte90 commented Jun 1, 2022

My issue is that my API URL has a initial slash (https://wakapi.dev/api//v1/users/current/heartbeats.bulk) but this will be appended with the endpoint URL so doesn't work.
The URL need to be sanitized, I am trying with url.adjusted(QUrl::NormalizePathSegments);

@Mte90
Copy link
Contributor Author

Mte90 commented Jun 1, 2022

Also on Kate starting I have tons of this:

offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788062-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788063-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788092-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788096-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788097-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788098-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788101-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788102-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788103-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788107-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788108-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788110-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788111-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788112-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788116-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788119-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788122-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788123-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788124-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788130-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788132-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788133-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788134-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788141-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788142-file-coding-planet--HIDDEN.php-0'"

Maybe instead to do various queries is enough to do just one.

@Tatsh
Copy link
Owner

Tatsh commented Jun 1, 2022

I will accept a PR to switch over to wakatime-cli #22. I did at one time have a branch for this change (back when wakatime was Python-based) but I found it to be oddly slow.

The biggest concern for the subprocess code is to make certain that the thread is locked/unlocked properly so it cannot run twice simultaneously and does not double post.

I still definitely prefer calling their API without calling a subprocess but ever since adding the heartbeat database code and then WakaTime switching to Go with BDB, this has become difficult to maintain.

@Tatsh Tatsh self-assigned this Dec 28, 2022
@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jun 29, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@Tatsh Tatsh reopened this Jul 13, 2023
@github-actions github-actions bot removed the stale label Jul 14, 2023
@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 14, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@Tatsh Tatsh reopened this Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants