Skip to content

[Feature] Cache in grouper#170

Merged
ilyamore88 merged 17 commits intomasterfrom
grouper-cache
Feb 25, 2021
Merged

[Feature] Cache in grouper#170
ilyamore88 merged 17 commits intomasterfrom
grouper-cache

Conversation

@khaydarov
Copy link
Copy Markdown
Member

@khaydarov khaydarov commented Nov 10, 2020

Adds cache usage to grouper worker.

@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Nov 10, 2020

This pull request introduces 1 alert when merging 138f487 into e0dd29c - view on LGTM.com

new alerts:

  • 1 for Missing await

@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Dec 9, 2020

This pull request introduces 1 alert when merging 601aa13 into 8a36ec8 - view on LGTM.com

new alerts:

  • 1 for Missing await

@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Dec 9, 2020

This pull request introduces 1 alert when merging 457fb16 into 8a36ec8 - view on LGTM.com

new alerts:

  • 1 for Missing await

@ilyamore88 ilyamore88 changed the title Grouper cache [Feature] Cache in grouper Dec 14, 2020
Comment thread workers/grouper/src/index.ts Outdated
/**
* Memoized Hashing computation
*/
private static cachedHashValues: {[key: string]: string} = {};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

не понятное название и описание: что за хэш, для чего memorized

Comment thread workers/grouper/src/index.ts Outdated
}

try {
const eventCacheKey = `${projectId}:${query.toString()}`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

а какой тип у query? если объект, то почему не JSON.stringify?

@ilyamore88 ilyamore88 requested a review from neSpecc December 15, 2020 17:52
Comment thread workers/grouper/src/index.ts Outdated
/**
* Forced clears worker cache
*/
public clearCache(): void {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

не логичнее это впихнуть в абстрактного воркера?

Comment thread workers/grouper/src/index.ts Outdated
public readonly type: string = pkg.workerType;

/**
* Contains hashed events by his catcher type and event title as keys
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

судя по примеру, там не ивент содержится, а его групхэш
и смущает his, может надо its?

Comment thread workers/grouper/src/index.ts
Comment thread workers/grouper/src/index.ts
@talyguryn talyguryn requested a review from nikmel2803 February 10, 2021 17:51
@ilyamore88 ilyamore88 merged commit 74754d0 into master Feb 25, 2021
@ilyamore88 ilyamore88 deleted the grouper-cache branch February 25, 2021 18:12
nikmel2803 added a commit that referenced this pull request Feb 27, 2021
* Check workspace event (#184)

* add definitions for limiter worker event types

* some code refactoring

* refactor logger creating logic

* refactor limiter worker and add second event type handler

* fix error if no workspace with provided id were found

* update docs

* fixes

* update docs

* fix linter errors

* add tests

* fix docs

* fix README.md

* upgrade eslint config codex (#187)

* [Feature] Paymaster checks subscription (#186)

* update hawk.types

* refactor paymaster worker

* fix lint warnings

* update hawk.types

* add tests for paymaster worker

* remove unused envs

* update README.md

* [Feature] Cache in grouper (#170)

* save changes

* memoize hashing

* update

* init cache

* fix eslint

* add missing await and async

* add missing async

* add clearCache method

* add type to query field, use JSON.stringify

* rewrite doc

* fix doc

* move clearCache to abstract worker

Co-authored-by: ilyamore88 <themorozik@gmail.com>

* fix(js): trim source code lines (#188)

* fix(js): trim source code lines

* Update string.ts

* Update lib/utils/string.ts

Co-authored-by: Taly <vitalik7tv@yandex.ru>

Co-authored-by: Taly <vitalik7tv@yandex.ru>

Co-authored-by: Nikita Melnikov <nikmel2803@gmail.com>
Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: Taly <vitalik7tv@yandex.ru>
ilyamore88 added a commit that referenced this pull request Mar 1, 2021
* Check workspace event (#184)

* add definitions for limiter worker event types

* some code refactoring

* refactor logger creating logic

* refactor limiter worker and add second event type handler

* fix error if no workspace with provided id were found

* update docs

* fixes

* update docs

* fix linter errors

* add tests

* fix docs

* fix README.md

* upgrade eslint config codex (#187)

* [Feature] Paymaster checks subscription (#186)

* update hawk.types

* refactor paymaster worker

* fix lint warnings

* update hawk.types

* add tests for paymaster worker

* remove unused envs

* update README.md

* [Feature] Cache in grouper (#170)

* save changes

* memoize hashing

* update

* init cache

* fix eslint

* add missing await and async

* add missing async

* add clearCache method

* add type to query field, use JSON.stringify

* rewrite doc

* fix doc

* move clearCache to abstract worker

Co-authored-by: ilyamore88 <themorozik@gmail.com>

* fix(js): trim source code lines (#188)

* fix(js): trim source code lines

* Update string.ts

* Update lib/utils/string.ts

Co-authored-by: Taly <vitalik7tv@yandex.ru>

Co-authored-by: Taly <vitalik7tv@yandex.ru>

* [Feature] Block workspace message in sender worker (#191)

* fix warning

* add types for block workspace message

* add some docs

* add logic for block workspace message

* fix import and type

* fix review comments

* send messages only to admins

* Metrics optimization (#193)

* optimize push time 1s -> 10s
* unhardcode push time -> .env
* `push` -> `pushAdd`

Co-authored-by: Nikita Melnikov <nikmel2803@gmail.com>
Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: Taly <vitalik7tv@yandex.ru>
Co-authored-by: Danil Beltyukov <beltyukovdanil@gmail.com>
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.

5 participants