mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 13:16:53 +00:00
Other: fix minor typo
This commit is contained in:
@ -91,7 +91,7 @@ func (c *controller) ListenAndServe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.WithError(err).Error("Cannot start listner.")
|
l.WithError(err).Error("Cannot start listener.")
|
||||||
c.signals.Emit(events.ErrorEvent, string(c.server.Protocol())+" failed: "+err.Error())
|
c.signals.Emit(events.ErrorEvent, string(c.server.Protocol())+" failed: "+err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,7 +153,7 @@ func (q *sendRecorder) deleteExpiredKeys() {
|
|||||||
for key, value := range q.hashes {
|
for key, value := range q.hashes {
|
||||||
// It's hard to find a good expiration time.
|
// It's hard to find a good expiration time.
|
||||||
// On the one hand, a user could set up some cron job sending the same message over and over again (heartbeat).
|
// On the one hand, a user could set up some cron job sending the same message over and over again (heartbeat).
|
||||||
// On the the other, a user could put the device into sleep mode while sending.
|
// On the other, a user could put the device into sleep mode while sending.
|
||||||
// Changing the expiration time will always make one of the edge cases worse.
|
// Changing the expiration time will always make one of the edge cases worse.
|
||||||
// But both edge cases are something we don't care much about. Important thing is we don't send the same message many times.
|
// But both edge cases are something we don't care much about. Important thing is we don't send the same message many times.
|
||||||
if time.Since(value.time) > 30*time.Minute {
|
if time.Since(value.time) > 30*time.Minute {
|
||||||
|
|||||||
@ -245,7 +245,7 @@ func (store *Store) createOrUpdateMessageEvent(msg *pmapi.Message) error {
|
|||||||
func (store *Store) createOrUpdateMessagesEvent(msgs []*pmapi.Message) error { //nolint:funlen
|
func (store *Store) createOrUpdateMessagesEvent(msgs []*pmapi.Message) error { //nolint:funlen
|
||||||
store.log.WithField("msgs", msgs).Trace("Creating or updating messages in the store")
|
store.log.WithField("msgs", msgs).Trace("Creating or updating messages in the store")
|
||||||
|
|
||||||
// Strip non meta first to reduce memory (no need to keep all old msg ID data during update).
|
// Strip non-meta first to reduce memory (no need to keep all old msg ID data during update).
|
||||||
err := store.db.View(func(tx *bolt.Tx) error {
|
err := store.db.View(func(tx *bolt.Tx) error {
|
||||||
b := tx.Bucket(metadataBucket)
|
b := tx.Bucket(metadataBucket)
|
||||||
for _, msg := range msgs {
|
for _, msg := range msgs {
|
||||||
@ -321,7 +321,7 @@ func clearNonMetadata(onlyMeta *pmapi.Message) {
|
|||||||
onlyMeta.Attachments = nil
|
onlyMeta.Attachments = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// txUpdateMetadataFromDB changes the the onlyMeta data.
|
// txUpdateMetadataFromDB changes the onlyMeta data.
|
||||||
// If there is stored message in metaBucket the size, header and MIMEType are
|
// If there is stored message in metaBucket the size, header and MIMEType are
|
||||||
// not changed if already set. To change these:
|
// not changed if already set. To change these:
|
||||||
// * size must be updated by Message.SetSize
|
// * size must be updated by Message.SetSize
|
||||||
|
|||||||
Reference in New Issue
Block a user