Conversation
Codecov Report
@@ Coverage Diff @@
## release/0.2.0 #148 +/- ##
=================================================
+ Coverage 18.11% 18.63% +0.51%
=================================================
Files 36 36
Lines 1325 1358 +33
Branches 46 47 +1
=================================================
+ Hits 240 253 +13
- Misses 1057 1077 +20
Partials 28 28
Continue to review full report at Codecov.
|
|
That's only for the InMemory driver. What about the Relational driver? Also, we've talked about a possible flag in the config to specify whether to delete from created_at date or from last_used date. |
|
|
@SnirShechter pls check |
Co-authored-by: lesagi <lesagi@gmail.com>
Co-authored-by: lesagi <lesagi@gmail.com>
lesagi
left a comment
There was a problem hiding this comment.
nothing crucial, everything looks fine
the .env I changed to the same format of choosing one option out of many as the 'storage' has
in the relativeDate, I'm trying to use const as much as I can, but that's just a general preference, you can ignore it if you think it's less readable
|
@lesagi I already accept your changes and commited them.. thanks for the explanation though. I asked for review again to check those changes and approve\request more changes |
| @@ -43,8 +43,8 @@ export class InMemoryStorage implements StorageDriver { | |||
| let deletedCount = 0 | |||
| import type { StoredUrl, UrlWithInformation, UrlRequestData, UrlInformation } from '../../types/url.js' | ||
| import type {StoredUrl, UrlWithInformation, UrlRequestData, UrlInformation} from '../../types/url.js' | ||
| import {logger} from "../../../logger/logger"; | ||
| import {getRawConfig} from "../../../../config/__test__/helpers"; |
There was a problem hiding this comment.
It's better to pass the expireFrom via the driver configurations instead of importing the config.
Also, you imported functions from the tests.
| if (relativeDate <= deleteBefore) { | ||
| this.storage.data.urls.delete(storedUrl.id) | ||
| deletedCount++ | ||
| } |
There was a problem hiding this comment.
Where's the Relational implementation?
src/config/validate.ts
Outdated
|
|
||
| function validateUrlExpireFrom(urlExpire: string): void { | ||
| logger.debug(`Start validateUrlExpireFrom with ${urlExpire}`) | ||
| if (!urlExpire || (urlExpire != 'create' && urlExpire != 'update')) { |
There was a problem hiding this comment.
The feature we talked about is "expire from either 'create' or 'last used' ". You should add the 'last used'.
Co-authored-by: Snir Shechter <me@snir.sh>
Co-authored-by: Snir Shechter <me@snir.sh>
|
@SnirShechter conflicts resolved |
Closes #16