Skip to content

Comments

Dynamicaly generate date parameter if not provided by user#372

Merged
yaleman merged 6 commits intoyaleman:mainfrom
Marcel43367:dynamicaly-generate-date-parameter-if-not-provided-by-user
Jun 1, 2025
Merged

Dynamicaly generate date parameter if not provided by user#372
yaleman merged 6 commits intoyaleman:mainfrom
Marcel43367:dynamicaly-generate-date-parameter-if-not-provided-by-user

Conversation

@Marcel43367
Copy link
Contributor

Set current date and time dynamicaly in functions addstatus() and addoutput().

@Marcel43367 Marcel43367 requested a review from yaleman as a code owner May 28, 2025 09:12
@yaleman
Copy link
Owner

yaleman commented May 28, 2025

Why remove the default from the validator, then add it to specific functions? This seems unnecessary.

@Marcel43367
Copy link
Contributor Author

Yes, you are right, it seems unnecessary. I've also struggled to find the reason why my uploads do not contain the correct date.
But the previous used defaults were set at the time the module was loaded—meaning, when the Python file was first imported and the dictionary was created, those default values were computed once and persisted for the lifetime of the process.
With my changes the date is set when the addStatus function is called.
In my implementation this is necessary, because the python script runs forever and so the import could have been done days before.

@yaleman yaleman force-pushed the dynamicaly-generate-date-parameter-if-not-provided-by-user branch from 4eebf89 to c21393c Compare June 1, 2025 02:50
@yaleman yaleman merged commit 0708d06 into yaleman:main Jun 1, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants