-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Cache dump to disk #41
Open
Ortovoxx
wants to merge
122
commits into
timotejroiko:master
Choose a base branch
from
Ortovoxx:cache-dump
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
ed2b4bb
Client now properly emits ready event on hot reload
Ortovoxx 0952695
Added directory property and added all session cached to folder which…
Ortovoxx 3e1bde3
Creates folder if it does not exist
Ortovoxx fe0b745
Added hot reloading explanation to README
Ortovoxx f4c66ea
Added temporary file loading and parsing. Fails with roles
Ortovoxx 1ee78f0
Added _unpatch method to guild class
Ortovoxx c1a6254
Added new client options
Ortovoxx 37a23c7
Greatly simplified session and sequence client option handling
Ortovoxx 9285dc3
Users can specify the exit events they desire or use default ones
Ortovoxx 79644c4
Added uncaughtExceptionOnExit bool to stop loop of uncaughExceptions
Ortovoxx 84afdb3
Added dumpCache method with sessions and client args
Ortovoxx 382516e
Assigns new shards to hotreload and calls dumpCache asynchronously if…
Ortovoxx dc31079
dumpCache sync file storing function
Ortovoxx 329bff9
Restores guilds and users
Ortovoxx f1f9161
Added restore cache client options
Ortovoxx e9770e7
Update README.md
Ortovoxx 1eec95b
Updated client options and added typings
Ortovoxx ea895b6
Added new typedefs
Ortovoxx a8be027
Added djs-light validate options
Ortovoxx 24fc69b
Added change for sessionData
Ortovoxx b9a1681
Reads session files from .sessions/sessions/{shardID}.json
Ortovoxx bb43047
Extra checks for validation of options and added back events
Ortovoxx 3bc84f4
Created _loadSesssions to load sessions from disk
Ortovoxx 63e6929
Added helper methods
Ortovoxx b3afb40
Added dumpCache and patchCache methods
Ortovoxx ca7ebd1
Added a _write method to write an array of cache data to disk
Ortovoxx 6a915d2
Implemented dumpCache
Ortovoxx 7fffe3b
Added better error handling for infinite uncaught exception loop
Ortovoxx 176ae7b
Client options
Ortovoxx 7dced34
implement _unpatch()
timotejroiko 75f15da
Channel unpatching
timotejroiko c12961c
message unpatch plus fixes
timotejroiko 422857d
wip: needs rethinking
timotejroiko fa3f48c
Linting
Ortovoxx ea0b8ee
Try catch around user supplied function
Ortovoxx 7838707
prevent exit events from bleeding into each other
timotejroiko 2ce1320
store caches
timotejroiko 3ff1f9a
unpatch channels in the guild object
timotejroiko ff30a01
Small syntax fixes
Ortovoxx 3713d0c
rework cache loading and storing
timotejroiko 1655dd6
load cache on identify
timotejroiko 50b1d95
fix conflict
timotejroiko 652635b
Small fixes
Ortovoxx f53ae0c
readme
timotejroiko 8d5f0c6
Added a last connected property to session data to avoid unnecessary …
Ortovoxx 658c0ac
Updated cache and session types. Maybe remove from readme
Ortovoxx 848658e
Small fixes and checks
Ortovoxx 86fb045
Fixed _loadSession + now returns data in line with user supplied data
Ortovoxx accb618
Made data more consistent
Ortovoxx 68634f4
Identify without loading cache if creating a new session
Ortovoxx dc630ac
Update init.js
Ortovoxx fa814e3
Moved loading of cache into resume event
Ortovoxx 27f3023
Temporary fix until we load client user
Ortovoxx 49f27b3
Checks the close sequence of the last shard and doesn't wait if it ex…
Ortovoxx d0db3c6
Moved session data to createShards
Ortovoxx b9d28ab
Stores shardCount in session object
Ortovoxx d806d78
shards.size -> totalShards
Ortovoxx 57c8601
Moved cache patching and added 15s timeout for resuming
Ortovoxx 48ab68f
Event listener removed
Ortovoxx c9542db
Client now properly emits ready event on hot reload
Ortovoxx a5b2546
Added directory property and added all session cached to folder which…
Ortovoxx 84d1aef
Creates folder if it does not exist
Ortovoxx 4966abf
Added hot reloading explanation to README
Ortovoxx f6f17d7
Added temporary file loading and parsing. Fails with roles
Ortovoxx 51523a6
Added _unpatch method to guild class
Ortovoxx bac0008
Added new client options
Ortovoxx 6129fbd
Greatly simplified session and sequence client option handling
Ortovoxx 10e9d7f
Users can specify the exit events they desire or use default ones
Ortovoxx e5d0a1e
Added uncaughtExceptionOnExit bool to stop loop of uncaughExceptions
Ortovoxx efc65ee
Added dumpCache method with sessions and client args
Ortovoxx 3fb04d1
Assigns new shards to hotreload and calls dumpCache asynchronously if…
Ortovoxx bc7900a
dumpCache sync file storing function
Ortovoxx 4fd675b
Restores guilds and users
Ortovoxx 81109ca
Added restore cache client options
Ortovoxx f66811b
Update README.md
Ortovoxx b226bb8
Updated client options and added typings
Ortovoxx 10e41d8
Added new typedefs
Ortovoxx d3a29aa
Added djs-light validate options
Ortovoxx b0ef952
Added change for sessionData
Ortovoxx 86ba965
Reads session files from .sessions/sessions/{shardID}.json
Ortovoxx 019a28c
Extra checks for validation of options and added back events
Ortovoxx 49777bd
Created _loadSesssions to load sessions from disk
Ortovoxx 09940cc
Added helper methods
Ortovoxx bac06e4
Added dumpCache and patchCache methods
Ortovoxx 5a7ec3c
Added a _write method to write an array of cache data to disk
Ortovoxx 4cc9bad
Implemented dumpCache
Ortovoxx a526fe7
Added better error handling for infinite uncaught exception loop
Ortovoxx 5c3234e
Client options
Ortovoxx 39f3322
implement _unpatch()
timotejroiko 35bd529
Channel unpatching
timotejroiko 6fa4af2
message unpatch plus fixes
timotejroiko 4de1442
wip: needs rethinking
timotejroiko 7be37e3
Linting
Ortovoxx 00d6e3c
Try catch around user supplied function
Ortovoxx 0d6ef2d
prevent exit events from bleeding into each other
timotejroiko 996c5d6
store caches
timotejroiko 46fb575
unpatch channels in the guild object
timotejroiko f233e03
Small syntax fixes
Ortovoxx c5c3dbc
rework cache loading and storing
timotejroiko 52efd4c
load cache on identify
timotejroiko 984a73b
fix conflict
timotejroiko 7ea9e94
Small fixes
Ortovoxx 36236e7
readme
timotejroiko 523a463
Added a last connected property to session data to avoid unnecessary …
Ortovoxx 0d7bd76
Updated cache and session types. Maybe remove from readme
Ortovoxx c6b21de
Small fixes and checks
Ortovoxx 0ce72a1
Fixed _loadSession + now returns data in line with user supplied data
Ortovoxx c91567b
Made data more consistent
Ortovoxx c966058
Identify without loading cache if creating a new session
Ortovoxx 76c52aa
Update init.js
Ortovoxx 74868b9
Moved loading of cache into resume event
Ortovoxx f9cf35b
Temporary fix until we load client user
Ortovoxx 8189e36
Checks the close sequence of the last shard and doesn't wait if it ex…
Ortovoxx 28a3e19
Moved session data to createShards
Ortovoxx 9f7df3b
Stores shardCount in session object
Ortovoxx 46d3d2e
shards.size -> totalShards
Ortovoxx fd20123
Moved cache patching and added 15s timeout for resuming
Ortovoxx f738d16
Event listener removed
Ortovoxx 0627789
Cleanup
Ortovoxx f37f68d
Merge branch 'cache-dump' of https://github.com/Ortovoxx/discord.js-l…
Ortovoxx b4ee875
Fixes from rebase
Ortovoxx 5dafdcd
Merge branch 'master' into cache-dump
timotejroiko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,7 @@ package-lock.json | |
.vscode | ||
.eslintrc.json | ||
.gitattributes | ||
.pnp.js | ||
.yarnrc.yml | ||
yarn.lock | ||
.sessions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a problem: optional chaining short circuits to
undefined
so if client.user is falsey, then its doing.has(undefined)
which will count as user not cached and attempt tofetch(undefined)
.There shouldnt ever be a situation where a guild is loaded without the client having logged in, especially now that you moved the cache loading to the resume event.