gitignore fix

This commit is contained in:
Daan
2025-06-04 23:18:29 +02:00
parent 57aad4ea1c
commit 2768bd4dd0
3 changed files with 21 additions and 23 deletions

2
.gitignore vendored
View File

@@ -4,7 +4,9 @@
# #
# Binaries for programs and plugins # Binaries for programs and plugins
* *
!*/
!*.* !*.*
*.exe *.exe
*.exe~ *.exe~
*.dll *.dll

View File

@@ -1,8 +0,0 @@
#!/bin/bash
echo "Generating..."
openssl genpkey -algorithm RSA -out ./hmac_key.pem -pkeyopt rsa_keygen_bits:4096
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -keyout api_key.pem -out api_cert.pem \
-subj "/C=NL/ST=Noord-Holland/L=Amsterdam/O=ExOrg/OU=IT/CN=localhost"

View File

@@ -94,25 +94,29 @@ func RetrieveTokenNames() []string {
} }
func InsertTask(name, uuid, command string, nodeids []string, date string, expire time.Time) error { func InsertTask(name, uuid, command string, nodeids []string, date string, expire time.Time) error {
for _, singleNodeid := range nodeids { log.Println(name, uuid, command, nodeids, date, expire)
var count int
err := db.QueryRow(declStat.CountDuplTasks, command, singleNodeid).Scan(&count)
if err != nil {
return fmt.Errorf("failed to count the task occurence: %w", err)
}
if count > 0 { /*
log.Println(WarnTag, "Skipped creation of a task because its a duplicate.") for _, singleNodeid := range nodeids {
log.Println(WarnTag, fmt.Sprintf("Details: NodeID: %s, Task name: %s", singleNodeid, name)) var count int
} else { err := db.QueryRow(declStat.CountDuplTasks, command, singleNodeid).Scan(&count)
formattedExpire := expire.Format(utilities.ExtLayout) // Safe format for DB
_, err = db.Exec(declStat.CreateTask, name, uuid, command, singleNodeid, date, formattedExpire)
if err != nil { if err != nil {
return fmt.Errorf("failed to create task: %w", err) return fmt.Errorf("failed to count the task occurence: %w", err)
}
if count > 0 {
log.Println(WarnTag, "Skipped creation of a task because its a duplicate.")
log.Println(WarnTag, fmt.Sprintf("Details: NodeID: %s, Task name: %s", singleNodeid, name))
} else {
formattedExpire := expire.Format(utilities.ExtLayout) // Safe format for DB
_, err = db.Exec(declStat.CreateTask, name, uuid, command, singleNodeid, date, formattedExpire)
if err != nil {
return fmt.Errorf("failed to create task: %w", err)
}
} }
} }
} */
return nil return nil
} }