diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c460a33cc6859336397979e23ee623806b6b48f8..ffc91071fb6d58ed18456d76d98a1e7e998889b9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -25,10 +25,10 @@ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> </component> <component name="PhpWorkspaceProjectConfiguration" interpreter_name="PHP 8.2" /> - <component name="ProjectColorInfo"><![CDATA[{ - "customColor": "", - "associatedIndex": 8 -}]]></component> + <component name="ProjectColorInfo">{ + "customColor": "", + "associatedIndex": 8 +}</component> <component name="ProjectId" id="2fGcSxoYpsPbNVbRh8sUxQtBiHv" /> <component name="ProjectViewState"> <option name="flattenModules" value="true" /> @@ -38,37 +38,37 @@ <option name="sortByType" value="true" /> <option name="sortKey" value="BY_TYPE" /> </component> - <component name="PropertiesComponent"><![CDATA[{ - "keyToString": { - "DefaultGoTemplateProperty": "Go File", - "Go Test.TestDummyRunnable in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestManagerEventHandling in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestResetStats in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestScheduleJob in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestStructure in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestTimeFunctionSame in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestWriteToDB1 in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestWriteToDB2 in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.TestWriteToDB4 in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "Go Test.go test gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", - "RunOnceActivity.ShowReadmeOnStart": "true", - "RunOnceActivity.go.formatter.settings.were.checked": "true", - "RunOnceActivity.go.migrated.go.modules.settings": "true", - "SHARE_PROJECT_CONFIGURATION_FILES": "true", - "git-widget-placeholder": "master", - "go.import.settings.migrated": "true", - "go.sdk.automatically.set": "true", - "last_opened_file_path": "/home/vs/workspaces/oss/go-libs/job-queues/nix/scripts", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "npm", - "settings.editor.selected.configurable": "http.proxy", - "vue.rearranger.settings.migration": "true" + <component name="PropertiesComponent">{ + "keyToString": { + "DefaultGoTemplateProperty": "Go File", + "Go Test.TestDummyRunnable in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestManagerEventHandling in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestResetStats in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestScheduleJob in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestStructure in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestTimeFunctionSame in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestWriteToDB1 in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestWriteToDB2 in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.TestWriteToDB4 in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "Go Test.go test gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.go.formatter.settings.were.checked": "true", + "RunOnceActivity.go.migrated.go.modules.settings": "true", + "SHARE_PROJECT_CONFIGURATION_FILES": "true", + "git-widget-placeholder": "master", + "go.import.settings.migrated": "true", + "go.sdk.automatically.set": "true", + "last_opened_file_path": "/home/vs/workspaces/oss/go-libs/job-queues/nix/scripts", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "http.proxy", + "vue.rearranger.settings.migration": "true" } -}]]></component> +}</component> <component name="RecentsManager"> <key name="CopyFile.RECENT_KEYS"> <recent name="$PROJECT_DIR$/nix/scripts" /> @@ -83,7 +83,7 @@ <module name="job-queues" /> <working_directory value="$PROJECT_DIR$" /> <go_parameters value="-i" /> - <kind /> + <kind value="FILE" /> <directory value="$PROJECT_DIR$" /> <filePath value="$PROJECT_DIR$" /> <method v="2" /> @@ -147,7 +147,7 @@ <module name="job-queues" /> <working_directory value="$PROJECT_DIR$" /> <go_parameters value="-i" /> - <kind /> + <kind value="DIRECTORY" /> <directory value="$PROJECT_DIR$" /> <filePath value="$PROJECT_DIR$" /> <framework value="gotest" /> diff --git a/database.go b/database.go index ea33671c4701a5e4f0636e1da02fb49eda232e78..4144f9c8676beb8cad69d108085d86cbbbd50c2e 100644 --- a/database.go +++ b/database.go @@ -5,7 +5,6 @@ package jobqueue import ( "errors" - "fmt" "gorm.io/gorm" "strings" "time" @@ -20,7 +19,6 @@ func (s *JobSyncer) CheckAndSaveOrUpdate(job JobPersistence) error { } db := s.manager.database - fmt.Println("Database: ", db) var existing JobPersistence result := db.Where("id = ?", job.GetID()).First(&existing) diff --git a/nix/scripts/deploy.nix b/nix/scripts/deploy.nix index b3243b52e01a6adeb88239fb94dd5649cbab374e..04535812c776066f3106e4b1d3f2e7742b9935b2 100644 --- a/nix/scripts/deploy.nix +++ b/nix/scripts/deploy.nix @@ -58,9 +58,9 @@ in echo_ok "done" exit 0 fi - + gitVersion="v$gitVersion" - + ${pkgs.git}/bin/git tag -a $gitVersion -m"chore: bump version" ${pkgs.git}/bin/git --no-pager log --decorate=short --pretty=oneline -n 5 ${pkgs.git}/bin/git push -o ci.skip origin ''${CI_COMMIT_REF_NAME} --tags diff --git a/nix/scripts/go-task.nix b/nix/scripts/go-task.nix index a319a257defd5ede95400fb3037f5cfb01a74e17..ceb1055655f6471704454c45a552168cb42fe801 100644 --- a/nix/scripts/go-task.nix +++ b/nix/scripts/go-task.nix @@ -1,69 +1,68 @@ {pkgs}: let taskfile = pkgs.writeTextFile { - name = "taskfile.yml"; - text = '' - version: '3' + name = "taskfile.yml"; + text = '' + version: '3' - tasks: - default: - cmds: - - task --list - silent: true - run-tests: - desc: Execute all tests. - aliases: - - rt - env: - TEST_BY_TASK: true - USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" - cmds: - - run-tests - silent: true + tasks: + default: + cmds: + - task --list + silent: true + run-tests: + desc: Execute all tests. + aliases: + - rt + env: + TEST_BY_TASK: true + USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" + cmds: + - run-tests + silent: true - run-extended-tests: - desc: Execute all tests including cover, bench and race tests. - aliases: - - ret - env: - TEST_BY_TASK: true - USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" - cmds: - - run-extended-tests - silent: true + run-extended-tests: + desc: Execute all tests including cover, bench and race tests. + aliases: + - ret + env: + TEST_BY_TASK: true + USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" + cmds: + - run-extended-tests + silent: true - build-cover-report: - desc: Build coverage report. - aliases: - - cr - env: - TEST_BY_TASK: true - cmds: - - build-cover-report - silent: true + build-cover-report: + desc: Build coverage report. + aliases: + - cr + env: + TEST_BY_TASK: true + cmds: + - build-cover-report + silent: true - check-code: - desc: Check code style, linting, and formatting. - aliases: - - cc - env: - USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" - cmds: - - check-code - silent: true + check-code: + desc: Check code style, linting, and formatting. + aliases: + - cc + env: + USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" + cmds: + - check-code + silent: true - git-commit: - desc: Commit changes. - aliases: - - gc - - commit - cmds: - - check-code - - cd "{{.USER_WORKING_DIR}}" && cd $(${pkgs.git}/bin/git rev-parse --show-toplevel) && nix run git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes#git-commit --no-write-lock-file - silent: true - env: - USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" - ''; - + git-commit: + desc: Commit changes. + aliases: + - gc + - commit + cmds: + - check-code + - cd "{{.USER_WORKING_DIR}}" && cd $(${pkgs.git}/bin/git rev-parse --show-toplevel) && nix run git+https://gitlab.schukai.com/schukai/entwicklung/nix-flakes#git-commit --no-write-lock-file + silent: true + env: + USER_WORKING_DIR: "{{.USER_WORKING_DIR}}" + ''; }; in pkgs.writeShellScriptBin "task" ''