This commit is contained in:
Thijs Stobbelaar 2023-11-14 10:45:07 +01:00
parent 3f0c80b3eb
commit 413e69a955
7 changed files with 18 additions and 7 deletions

View file

@ -7,7 +7,7 @@ else {
$scriptroot = $PSScriptRoot $scriptroot = $PSScriptRoot
} }
. $scriptroot\..\includes\ps1\lockfile.ps1 . $scriptroot\..\includes\ps1\lockfile.ps1
new-lock new-lock -by "report_new_matches"
$fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw

View file

@ -7,7 +7,7 @@ else {
$scriptroot = $PSScriptRoot $scriptroot = $PSScriptRoot
} }
. $scriptroot\..\includes\ps1\lockfile.ps1 . $scriptroot\..\includes\ps1\lockfile.ps1
new-lock new-lock -by "report_to_discord"
function IsValidEntry($entry) { function IsValidEntry($entry) {
return ($entry.KD_H -ne 'NaN' -and $entry.KD_ALL -ne 'NaN') -and return ($entry.KD_H -ne 'NaN' -and $entry.KD_ALL -ne 'NaN') -and
($entry.KD_H -ne 'Infinity' -and $entry.KD_ALL -ne 'Infinity') ($entry.KD_H -ne 'Infinity' -and $entry.KD_ALL -ne 'Infinity')

View file

@ -1,4 +1,10 @@
function new-lock { function new-lock {
[CmdletBinding()]
param (
[Parameter()]
[string]
$by
)
Write-Output 'Setting lock' Write-Output 'Setting lock'
$lock = $true $lock = $true
$timeout = 10 $timeout = 10
@ -23,6 +29,9 @@ function new-lock {
$i++ $i++
} }
New-Item -ItemType File -Path $lockFile | Out-Null New-Item -ItemType File -Path $lockFile | Out-Null
if ($by) {
$by | Out-File -FilePath $lockFile -Append
}
} }
function remove-lock { function remove-lock {

View file

@ -6,7 +6,7 @@ else {
} }
. $scriptroot\..\includes\ps1\lockfile.ps1 . $scriptroot\..\includes\ps1\lockfile.ps1
new-lock new-lock -by "get_matches"
# Read the content of the file as a single string # Read the content of the file as a single string
$fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw

View file

@ -10,7 +10,7 @@ else {
} }
. $scriptroot\..\includes\ps1\lockfile.ps1 . $scriptroot\..\includes\ps1\lockfile.ps1
new-lock new-lock -by "matchparser"
##SETTINGS ##SETTINGS
$monthsback = -1 # how many months back to look for matches $monthsback = -1 # how many months back to look for matches
##END OF SETTINGS ##END OF SETTINGS

View file

@ -1,11 +1,13 @@
. .\..\includes\ps1\lockfile.ps1 
new-lock
if($PSScriptRoot.length -eq 0){ if($PSScriptRoot.length -eq 0){
$scriptroot = Get-Location $scriptroot = Get-Location
}else{ }else{
$scriptroot = $PSScriptRoot $scriptroot = $PSScriptRoot
} }
. $scriptroot\..\includes\ps1\lockfile.ps1
new-lock -by "update_clan"
# Read the content of the file as a single string # Read the content of the file as a single string
$fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw

View file

@ -10,7 +10,7 @@ else {
} }
. $scriptroot\..\includes\ps1\lockfile.ps1 . $scriptroot\..\includes\ps1\lockfile.ps1
new-lock new-lock -by "update_clan_members"
# Read the content of the file as a single string # Read the content of the file as a single string
$fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw