-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raising errors and applying caching #896
Conversation
Old Energy EstimationEco-CI Output:
🌳 CO2 Data: |
aaecc33
to
d2e1769
Compare
Eco-CI Output:
🌳 CO2 Data: |
@ribalba Can you please still review. Since the code is live for 2 weeks now I will merge in for now, but still need your feedback here |
* First version * Added daily to allowed schedule modes for default user * REmoving user_id from object repr * SQL typo * Fixed timeout tests * Database is now reloaded from structure file instead of truncate * Authenticate now returns user obj instead of just ID * Updated diff test signature * Using TRUNCATE CASCADE to clear DB * DELETE script for retention expired * Implemented measurement quota with many tests and refactorings * Removed noise * Email adding was not possible without user_id * migration needs to be wrapped around [skip ci] * user_id added to hog, ci and carbond * CarbonDB user_id column [skip ci] * Adding user_id to structure * Added more JOINs for delete [skip ci] * Added machine to error in client.py [skip ci] * Run-ID link and class name added to errors * Run-ID Link only of not empty [skip ci] * Authentication token is now not DEFAULT in frontend. Only in API. Added tests * Added no-transform class * Guard claused import_csv * Added comment * Raising errors and applying caching (#896)
|
@ribalba
I am currently trying to investigate an error we are seeing with the API when adding CarbonDB entries alongside CI measurements.
As seen the value for carbon_intensity is empty.
What I did
get_geo()
orget_carbon_intensity()
fail. This was not in your code. Can you state why? What is the intention of proceeding with a None value?green-metrics-tool/api/api_helpers.py
Line 734 in 7a0d9ea
green-metrics-tool/api/api_helpers.py
Line 757 in 7a0d9ea
@cache
I call the functions in an else block and thus achieve that the API is not constantly polled again for identical submissions. The@cache
should only be valid for the request and no longer./v1/ci/measurement/add
call when CarbonDB fails, but rather return a HTTP 207. What do you think of this solution?