Memory Leak on Azure
Opened this issue · 0 comments
TubaBayraktutar commented
Hello,
I am using the latest version of redux-state-sync. As you can see in the graph below, the usage of RAM is constantly increasing.
Node version is 14.16.1
Store configuration;
import { createStore, applyMiddleware, compose } from 'redux';
import {
createStateSyncMiddleware,
withReduxStateSync,
initStateWithPrevTab
} from 'redux-state-sync';
import Router from 'next/router';
import reducer from './reducer';
import middlewares from './middleware';
import { actionType } from './actions';
const composeEnhancers = (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;
const stateSyncConfig = {
channel: 'my_project_redux_state_sync',
whitelist: [
actionType.StateClear,
'StateMerge',
'StatesMerge',
'PrependToKey',
'AddToKey',
'RemoveFromKey'
]
};
export const initStore =
(initialState = {
apiUrl: process.env.API_URL || 'http://localhost:5000',
auctionHubState: 'Initializing'
}) => {
console.log(JSON.stringify(process.env));
const storeMiddlewares = [createStateSyncMiddleware(stateSyncConfig)];
if (process.browser && Router.route === '/home') {
storeMiddlewares.push(...middlewares);
}
const store =
createStore(
withReduxStateSync(reducer),
initialState,
composeEnhancers(
applyMiddleware(...storeMiddlewares)
)
);
if (process.browser && Router.route !== '/operator') {
initStateWithPrevTab(store);
}
return store;
};