mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 19:43:04 +08:00
Launch dashboard when in dev mode, publish change on acct creation
This commit is contained in:
parent
f678045c4f
commit
b67a3ae3e4
4 changed files with 5 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
redis: redis-server
|
||||
web: node packages/nylas-api/app.js
|
||||
worker: node packages/nylas-sync/app.js
|
||||
dashboard: node packages/nylas-dashboard/app.js
|
||||
|
|
|
@ -4,6 +4,7 @@ module.exports = (db, sequelize) => {
|
|||
sequelize.addHook("afterCreate", ({dataValues, $modelOptions}) => {
|
||||
if ($modelOptions.name.singular === 'Account') {
|
||||
PubsubConnector.broadcastClient().lpushAsync('accounts:unclaimed', dataValues.id);
|
||||
PubsubConnector.notifyAccountChange(dataValues.id);
|
||||
}
|
||||
})
|
||||
sequelize.addHook("afterUpdate", ({dataValues, $modelOptions}) => {
|
||||
|
|
|
@ -10,7 +10,6 @@ const HEARTBEAT_EXPIRES = 30; // 2 min in prod?
|
|||
const CLAIM_DURATION = 10 * 60 * 1000; // 2 hours on prod?
|
||||
|
||||
const PubsubConnector = require('./pubsub-connector');
|
||||
const SyncPolicy = require('./sync-policy');
|
||||
|
||||
const forEachAccountList = (forEachCallback) => {
|
||||
const client = PubsubConnector.broadcastClient();
|
||||
|
|
|
@ -7,7 +7,7 @@ const {forEachAccountList} = SchedulerUtils;
|
|||
global.Promise = require('bluebird');
|
||||
|
||||
const server = new Hapi.Server();
|
||||
server.connection({ port: process.env.PORT || 5101 });
|
||||
server.connection({ port: process.env.PORT / 1 + 1 || 5101 });
|
||||
|
||||
DatabaseConnector.forShared().then(({Account}) => {
|
||||
server.register([HapiWebSocket, Inert], () => {
|
||||
|
@ -62,14 +62,14 @@ DatabaseConnector.forShared().then(({Account}) => {
|
|||
path: '/{param*}',
|
||||
handler: {
|
||||
directory: {
|
||||
path: 'public',
|
||||
path: require('path').join(__dirname, 'public'),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
server.start((startErr) => {
|
||||
if (startErr) { throw startErr; }
|
||||
console.log('Server running at:', server.info.uri);
|
||||
console.log('Dashboard running at:', server.info.uri);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue