File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ class GuildConfigsCache extends Store {
5656 } catch ( err ) {
5757 throw new AxonError ( `Cannot retrieve guildConfig from the DB: Guild: ${ key } \n${ err . stack } ` , 'AxonClient' , 'GuildConfigsCache' ) ;
5858 }
59- this . set ( key , guildConfig ) ;
6059 }
6160 return guildConfig ;
6261 }
@@ -69,16 +68,19 @@ class GuildConfigsCache extends Store {
6968 * @memberof GuildConfigsCache
7069 */
7170 async fetch ( gID ) {
71+ let guildConfig ;
72+
7273 try {
73- let guildConfig = await this . _axon . DBProvider . fetchGuild ( gID ) ;
74+ guildConfig = await this . _axon . DBProvider . fetchGuild ( gID ) ;
7475 if ( ! guildConfig ) {
7576 guildConfig = await this . _axon . DBProvider . initGuild ( gID ) ;
7677 }
77- return guildConfig ;
78- } catch ( err ) {
79- const newGuildConfig = await this . _axon . DBProvider . initGuild ( gID ) ;
80- return newGuildConfig ;
78+ } catch ( _ ) {
79+ guildConfig = await this . _axon . DBProvider . initGuild ( gID ) ;
8180 }
81+
82+ this . set ( gID , guildConfig ) ;
83+ return guildConfig ;
8284 }
8385
8486 /**
You can’t perform that action at this time.
0 commit comments