mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Prevent an event-processing error if there is no timezone setting
refs https://github.com/TryGhost/Ghost/pull/14197 - We default to UTC when there is no setting timezone
This commit is contained in:
parent
527ef79955
commit
91d5fa0fc5
1 changed files with 7 additions and 1 deletions
|
@ -88,7 +88,13 @@ class GhostEventProcessor extends EventProcessor {
|
||||||
opened_at: this.db.knex.raw('COALESCE(opened_at, ?)', [moment.utc(event.timestamp).format('YYYY-MM-DD HH:mm:ss')])
|
opened_at: this.db.knex.raw('COALESCE(opened_at, ?)', [moment.utc(event.timestamp).format('YYYY-MM-DD HH:mm:ss')])
|
||||||
});
|
});
|
||||||
|
|
||||||
const {value: timezone} = await this.db.knex('settings').first('value').where('key', 'timezone');
|
// Using the default timezone set in https://github.com/TryGhost/Ghost/blob/2c5643623db0fc4db390f6997c81a73dca7ccacd/core/server/data/schema/default-settings/default-settings.json#L105
|
||||||
|
let timezone = 'Etc/UTC';
|
||||||
|
const timezoneData = await this.db.knex('settings').first('value').where('key', 'timezone');
|
||||||
|
if (timezoneData && timezoneData.value) {
|
||||||
|
timezone = timezoneData.value;
|
||||||
|
}
|
||||||
|
|
||||||
await this.db.knex('members')
|
await this.db.knex('members')
|
||||||
.where('email', '=', event.recipientEmail)
|
.where('email', '=', event.recipientEmail)
|
||||||
.andWhere(builder => builder
|
.andWhere(builder => builder
|
||||||
|
|
Loading…
Reference in a new issue