mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 21:05:15 +00:00
Change default heartbeat spacing to 30 seconds
This commit is contained in:
parent
60b1c15623
commit
6efdd05be9
4 changed files with 9 additions and 3 deletions
|
|
@ -5,6 +5,7 @@
|
|||
[settings]
|
||||
api_url = https://<%= request.host_with_port %>/api/hackatime/v1
|
||||
api_key = <%= @user.api_keys.last.token %>
|
||||
heartbeat_rate_limit_seconds = 30
|
||||
|
||||
# any other wakatime configs you want to add: https://github.com/wakatime/wakatime-cli/blob/develop/USAGE.md#ini-config-file
|
||||
</pre>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@
|
|||
<div class="code-block">
|
||||
<code>[settings]
|
||||
api_url = <%= api_hackatime_v1_url %>
|
||||
api_key = <%= @current_user_api_key %></code>
|
||||
api_key = <%= @current_user_api_key %>
|
||||
heartbeat_rate_limit_seconds = 30</code>
|
||||
<button class="copy-button" onclick="copyCode(this)">Copy</button>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ try {
|
|||
[settings]
|
||||
api_url = $env:HACKATIME_API_URL
|
||||
api_key = $env:HACKATIME_API_KEY
|
||||
heartbeat_rate_limit_seconds = 30
|
||||
"@ | Out-File -FilePath $configPath -Force -Encoding utf8
|
||||
|
||||
Write-Host "Config file created at $configPath"
|
||||
|
|
@ -15,6 +16,7 @@ api_key = $env:HACKATIME_API_KEY
|
|||
$config = Get-Content $configPath
|
||||
$apiUrl = ($config | Select-String "api_url").ToString().Split('=')[1].Trim()
|
||||
$apiKey = ($config | Select-String "api_key").ToString().Split('=')[1].Trim()
|
||||
$heartbeatRate = ($config | Select-String "heartbeat_rate_limit_seconds").ToString().Split('=')[1].Trim()
|
||||
|
||||
# Display verification info
|
||||
Write-Host "API URL: $apiUrl"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ cat > ~/.wakatime.cfg << EOL
|
|||
[settings]
|
||||
api_url = ${HACKATIME_API_URL}
|
||||
api_key = ${HACKATIME_API_KEY}
|
||||
heartbeat_rate_limit_seconds = 30
|
||||
EOL
|
||||
|
||||
echo "Config file created at ~/.wakatime.cfg"
|
||||
|
|
@ -18,9 +19,10 @@ fi
|
|||
|
||||
API_URL=$(sed -n 's/.*api_url = \(.*\)/\1/p' ~/.wakatime.cfg)
|
||||
API_KEY=$(sed -n 's/.*api_key = \(.*\)/\1/p' ~/.wakatime.cfg)
|
||||
HEARTBEAT_RATE_LIMIT=$(sed -n 's/.*heartbeat_rate_limit_seconds = \(.*\)/\1/p' ~/.wakatime.cfg)
|
||||
|
||||
if [ -z "$API_URL" ] || [ -z "$API_KEY" ]; then
|
||||
echo "Error: Could not read api_url or api_key from config"
|
||||
if [ -z "$API_URL" ] || [ -z "$API_KEY" ] || [ -z "$HEARTBEAT_RATE_LIMIT" ]; then
|
||||
echo "Error: Could not read api_url, api_key, or heartbeat_rate_limit_seconds from config"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue