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