mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-27 02:19:46 +08:00
[cloud-api] Base infrastructure for running cloud workers
Summary: I've decided to break my snooze patches in multiple parts to make it easier to review. This diff contains all the code related to running workers in the cloud. Cloud workers all inherit from the `Worker` class which defines a bunch of useful things like error handling. What's left to do: - spawn workers based on the plugin type - add monitoring (I'm going to add a simple HTTP endpoint for that) - writing a migration for the local sync db and the prod metadata db. Test Plan: Tested manually. Reviewers: halla, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3814
This commit is contained in:
parent
cb9faea6f0
commit
ae32666609
3 changed files with 20 additions and 2 deletions
|
@ -217,6 +217,7 @@ module.exports = (sequelize, Sequelize) => {
|
|||
labels: this.labels ? this.labels.map(l => l.toJSON()) : [],
|
||||
imap_uid: this.folderImapUID,
|
||||
thread_id: this.threadId,
|
||||
message_id_header: this.headerMessageId,
|
||||
};
|
||||
},
|
||||
},
|
||||
|
|
|
@ -19,8 +19,9 @@ apps:
|
|||
watch : ["packages"]
|
||||
name : workers
|
||||
env :
|
||||
DB_NAME : "nylasmailclouddb"
|
||||
DB_ENCRYPTION_ALGORITHM : "aes-256-ctr"
|
||||
DB_ENCRYPTION_PASSWORD : "d6F3Efeq"
|
||||
NODE_ENV: 'development'
|
||||
- script : redis-server
|
||||
name : redis
|
||||
- script : scripts/run-redis.sh
|
||||
name : redis
|
||||
|
|
16
scripts/run-redis.sh
Executable file
16
scripts/run-redis.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Redis is one of those servers which by default
|
||||
# accept connections from everywhere. Luckily,
|
||||
# homebrew and presumably debian come with sane
|
||||
# defaults. However, they're located in different
|
||||
# directories.
|
||||
if [[ $(uname) = 'Darwin' ]]; then
|
||||
echo "Running redis from Homebrew..."
|
||||
redis-server /usr/local/etc/redis.conf
|
||||
fi
|
||||
|
||||
if [[ $(uname) = 'Linux' ]]; then
|
||||
echo "Running redis"
|
||||
redis-server /etc/redis/redis.conf
|
||||
fi
|
Loading…
Reference in a new issue