Skip to content

Conversation

@shay123g
Copy link
Contributor

Closes #16

@codecov
Copy link

codecov bot commented Mar 13, 2021

Codecov Report

Merging #148 (75c9a8f) into release/0.2.0 (5afc392) will increase coverage by 0.51%.
The diff coverage is 25.92%.

Impacted file tree graph

@@                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              
Impacted Files Coverage Δ
src/config/index.ts 0.00% <0.00%> (ø)
src/config/types.ts 0.00% <0.00%> (ø)
src/index.ts 0.00% <0.00%> (ø)
src/services/storage/drivers/inMemory/index.ts 0.00% <0.00%> (ø)
src/services/storage/drivers/relational/index.ts 0.00% <0.00%> (ø)
src/services/storage/drivers/relational/types.ts 0.00% <0.00%> (ø)
src/services/storage/index.ts 0.00% <0.00%> (ø)
src/config/validate.ts 91.52% <75.00%> (-1.21%) ⬇️
src/config/__test__/helpers.ts 100.00% <100.00%> (ø)
src/config/normalize.ts 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5afc392...75c9a8f. Read the comment docs.

@SnirShechter
Copy link
Member

@shay123g

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.

@shay123g
Copy link
Contributor Author

shay123g commented Mar 13, 2021

@shay123g

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.

  1. I will fix
  2. Relational - @Danielg212 still working on it, he need to complete the fix for deleteOverdue

Shay.Gazit added 3 commits March 13, 2021 21:01
 into release/0.2.0

� Conflicts:
�	src/services/storage/drivers/inMemory/index.ts
@shay123g
Copy link
Contributor Author

@SnirShechter pls check

@shay123g shay123g requested review from SnirShechter and lesagi and removed request for Danielg212, SnirShechter and lesagi March 16, 2021 11:13
@shay123g shay123g requested a review from lesagi March 16, 2021 11:38
shay123g and others added 2 commits March 16, 2021 13:39
Co-authored-by: lesagi <lesagi@gmail.com>
Co-authored-by: lesagi <lesagi@gmail.com>
Copy link
Contributor

@lesagi lesagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@shay123g
Copy link
Contributor Author

@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

@shay123g shay123g requested a review from lesagi March 16, 2021 14:14
@shay123g shay123g changed the title #16 url cleanup upgrade Mar 17, 2021
@shay123g shay123g linked an issue Mar 17, 2021 that may be closed by this pull request
}
public async deleteOverdue(timespanMs: number): Promise<number> {
const deleteBefore = new Date().getTime() - timespanMs
let deletedCount = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the comment in the PR

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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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++
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the Relational implementation?


function validateUrlExpireFrom(urlExpire: string): void {
logger.debug(`Start validateUrlExpireFrom with ${urlExpire}`)
if (!urlExpire || (urlExpire != 'create' && urlExpire != 'update')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature we talked about is "expire from either 'create' or 'last used' ". You should add the 'last used'.

shay123g and others added 2 commits March 22, 2021 10:04
Co-authored-by: Snir Shechter <me@snir.sh>
Co-authored-by: Snir Shechter <me@snir.sh>
Shay.Gazit added 2 commits March 23, 2021 21:17
@shay123g shay123g requested a review from SnirShechter March 23, 2021 19:32
Shay.Gazit added 3 commits March 28, 2021 19:37
 into 16

� Conflicts:
�	src/config/types.ts
�	src/index.ts
�	src/services/storage/drivers/inMemory/index.ts
�	src/services/storage/drivers/relational/index.ts
@shay123g
Copy link
Contributor Author

@SnirShechter conflicts resolved

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.

Url cleanup upgrades

5 participants