pcal43 / fastback

Fast, incremental Minecraft world backups. Powered by Git.
https://pcal43.github.io/fastback/
GNU General Public License v2.0
122 stars 19 forks source link

any command causes to run `git --version` and `git lfs --version` multiple times #326

Open Merith-TK opened 2 months ago

Merith-TK commented 2 months ago

I ran backup gc after making a backup

image

Merith-TK commented 2 months ago

fresh logs from local dev

[05:46:56] [Server thread/INFO] (Minecraft) <Mekrath> running gc
[05:47:01] [Server thread/INFO] (fastback) [DEBUG] executing net.pcal.fastback.commands.Commands$$Lambda$8014/0x000002ac82fd5a68@352b0d1b
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] Executing git --version
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] PATH: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] USER: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] HOME: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] [STDOUT] git version 2.42.0.windows.2
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] Executing git lfs --version
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] PATH: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] USER: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] HOME: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] [STDOUT] git-lfs/3.4.0 (GitHub; windows amd64; go 1.20.6; git d06d6e9e)
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] Executing git --version
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] PATH: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] USER: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] HOME: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] [STDOUT] git version 2.42.0.windows.2
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] Executing git lfs --version
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] PATH: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] USER: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] HOME: null
[05:47:01] [pool-6-thread-1/INFO] (fastback) [DEBUG] [STDOUT] git-lfs/3.4.0 (GitHub; windows amd64; go 1.20.6; git d06d6e9e)
Merith-TK commented 2 months ago

found where it is its the isNativeOk() checks, they call the functions multiple times

perhaps caching the results of the version strings could help with this