Skip to content
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

Duplicate run when use multiple time #42

Closed
2 tasks done
armada45-pixel opened this issue May 3, 2024 · 2 comments · Fixed by #43
Closed
2 tasks done

Duplicate run when use multiple time #42

armada45-pixel opened this issue May 3, 2024 · 2 comments · Fixed by #43
Labels
needs repro Need small reproduction type: bug This issue defined as a bug

Comments

@armada45-pixel
Copy link
Contributor

Before open the issue

  • I tried remove node_modules/, bun.lockb, and do a clean installation.
  • I tried update Bun, and Elysia to latest version.

Describe the bug
Like title
Duplicate run when use multiple time
Issue example
gaurishhs/elysia-ip#18 (comment)

onBeforehandler will stack not repleace them seft if not using name in plugin instance

new Elysia()

and name it using

new Elysia({ name: "elysia-rate-limit" })

Screenshots
image

@armada45-pixel
Copy link
Contributor Author

I'm in process will pull request soon.

@rayriffy rayriffy added needs repro Need small reproduction type: bug This issue defined as a bug labels May 3, 2024
@rayriffy
Copy link
Owner

rayriffy commented May 3, 2024

small reproduction needed

armada45-pixel added a commit to armada45-pixel/elysia-rate-limit that referenced this issue May 3, 2024
rayriffy added a commit that referenced this issue May 22, 2024
* - add update all dependencies ( using pnpm )
- update dependencies

* - remove cache bun.lockb

* - add using server
- add getServer type

* better getServer ?

* change get server to using object store server

* - add throw error when rate-limit reached
- add type needRequestIP
- edit getserver for support only need requestIP function

* add getServer Docs

* add throwOnError Docs

* export default option

* fix for #40 (review)

* update dependencies

* add default options use as global option in example

* fix: export variable name as-is

* refactor: grouping if condition

* refactor: errorResponse

* chore: regenerate lockfile

* refactor: getServer -> injectServer

* docs: changeset

* fix: redundant typeof check

* Version Packages

* change type inject Server return value to server or null

* update dependencies

* fix #42

* update dependencies

* app.server null fixed

* docs: typo

* feat: changeset

* update dependencies

* fix rate limit not working

* add script run multiInstanceInjected file

* change scope

* fix: scoping

* fix: typo

---------

Co-authored-by: Phumrapee Limpianchop <git@rayriffy.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Need small reproduction type: bug This issue defined as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants