tokei icon indicating copy to clipboard operation
tokei copied to clipboard

Badge not working

Open 3kh0 opened this issue 2 years ago • 5 comments

I have a repo with over 200k lines of code and it is only showing 0 lines.

Here is the repo: https://github.com/3kh0/3kh0.github.io

Here is what I see: Lines of code

3kh0 avatar Feb 04 '22 22:02 3kh0

No need to look that far, the same happened with tokei 😃.

ljedrz avatar Feb 05 '22 09:02 ljedrz

Seems to be working again :+1:.

ljedrz avatar Feb 17 '22 09:02 ljedrz

It's broken again, showing 0 lines :crying_cat_face:

DomWilliams0 avatar Mar 03 '22 14:03 DomWilliams0

I also ran into the server being a bit on/off. If you want to set up your own mirror of tokei, I figured out how to do this in ~5 minutes with Render.

Since the tokei_rs web application is just a standard Actix app that you can run with cargo run --release, and it serves web requests to a HTTP port, you can just make a web service on Render, enter https://github.com/XAMPPRocky/tokei_rs as the source of the code, set the build to Rust, and keep all of the default options. It'll automatically compile and build the code. E.g., I have one running on tokei.ekzhang.com right now.

Here's an example badge from it (https://tokei.ekzhang.com/b1/github/XAMPPRocky/tokei):

This also costs me $0/month with their free plan, which is nice.

ekzhang avatar Mar 08 '22 00:03 ekzhang

@ekzhang thank you! Planning to use your server for now if that's OK. https://tokei.ekzhang.com/b1/github/sparks-baird/mat_discover

sgbaird avatar May 28 '22 19:05 sgbaird

I tried self-hosting using Render as suggested above, but sometimes I was having issues with request timeouts, so I decided to port the API to a Vercel serverless function: https://github.com/aschey/vercel-tokei. You can fork the repo and host it on your own Vercel account for free or you can use the URL I provided in the repo. I've been using it for a few months now and it's been working great so far. It should be pretty resilient against going down for very long since it's serverless and the containers it runs on will frequently be destroyed and recreated.

aschey avatar Sep 24 '22 14:09 aschey

Is this still a issue?

3kh0 avatar Sep 05 '23 20:09 3kh0

Is this still a issue?

From my repositories, yes, it still is an issue.

AnalogFeelings avatar Sep 16 '23 22:09 AnalogFeelings

Damn, over a whole year too

3kh0 avatar Sep 17 '23 17:09 3kh0

Thank you for your issue! I'm going to close as a duplicate of https://github.com/XAMPPRocky/tokei_rs/issues/123 and wont fix. I don't control shields.io. I can't do anything about their implementation, I only control using tokei.rs directly.

Damn, over a whole year too

@3kh0 This a passion project I maintain in my spare time after a full-time job, other obligations, and other side-projects. Maintaining popular services require time and money, GitHub sponsors barely cover food for the month, so you can understand why this not my focus.

XAMPPRocky avatar Sep 18 '23 07:09 XAMPPRocky

@XAMPPRocky I completely understand, luck to you!

3kh0 avatar Sep 18 '23 15:09 3kh0

hey there @XAMPPRocky :wave: I'm one of the maintainers of Shields and wanted to chime in (and to be clear, not in opposition to closing this issue; I agree with closing it), but more specifically on this :point_down:

I'm going to close as a duplicate of https://github.com/XAMPPRocky/tokei_rs/issues/123 and wont fix. I don't control shields.io. I can't do anything about their implementation, I only control using tokei.rs directly.

I'm not completely convinced that I correctly understand this, but it gives me the impression you believe there's an issue on our side, which if so would puzzle me.

We're not doing anything particularly interesting nor esoteric from Shields, we're simply querying the tokei.rs API with the json content type header, and then looking at the response. We've seen https://github.com/XAMPPRocky/tokei_rs/issues/123 intermittently (where the API responds with values of 0), and more recently https://github.com/XAMPPRocky/tokei_rs/issues/233 where the API response structure changed at some point and no longer contains the lines field.

If you think there's something we're missing and/or need to do differently to properly consume your API then please let us know (feel free to tag me on any relevant issues in tokei.rs or reach out to us in https://github.com/badges/shields)

calebcartwright avatar Sep 18 '23 18:09 calebcartwright

2024 and this issue is still happening. We know it is a tokei problem, not a problem with shields.io, but anyway I thought that they were going to fix it...

AleixMT avatar Feb 28 '24 14:02 AleixMT

There's no "they" there's only me, and I am not paid to work on this project. It's a personal project. If you want a more reliable service feel free to host it yourself. 🙂

XAMPPRocky avatar Feb 28 '24 15:02 XAMPPRocky

There's no "they" there's only me, and I am not paid to work on this project. It's a personal project. If you want a more reliable service feel free to host it yourself. 🙂

Okay, sorry for my ignorance. I completely understand. So it is a problem about the cost of hosting and not about the code not working right?

Anyway, either if you can or can't fix it I think this is a very valuable software and it should be a service that is integrated in github... At least we could sponsor you (this is what I will do). Thank you!

AleixMT avatar Feb 28 '24 16:02 AleixMT