Merge pull request #106 from OpzekerIT/dev

s
This commit is contained in:
Lanta 2023-11-14 10:45:58 +01:00 committed by GitHub
commit 650d54a379
7 changed files with 18 additions and 7 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,13 @@
. .\..\includes\ps1\lockfile.ps1

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

View file

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