Automatically calculate average temperature and store the result. #727
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#727
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
At the moment tempSensor generates alot of data. This will become problematic when we launch the application on the server. The obvious solution would be to delete old data. This unfortunately can't be done because we need old data to generate average temperature for year/month.
What should be done
After each day (00:00) all of the previous days data should be used to calculate average. The average should be places in a new table. AvrageTempDay. After this is done all of the previus days temp data should be removed.
Do we want to keep the scheduling logic in the postgres DB (this would mean using pg_cron or similar) or in the application backend (asp.net extensions)? @a22erigr @c24danli
Looking in to it
As per this comment we will use pg_cron to schedule database tasks
@a24vinla wrote in #727 (comment):
I will change name of new table from AvrageTempDay to t_sensors_daily_average, if that is OK? @a22erigr @c24danli
@a24vinla wrote in #727 (comment):
After a long and thorough discussion with the leadership we have decided that this decision is okay
Has been merged in #898