On Sun, 17 Oct 2021 at 21:43, <[email protected]> wrote: > > This is an automated email from the ASF dual-hosted git repository. > > humbedooh pushed a commit to branch master > in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git > > > The following commit(s) were added to refs/heads/master by this push: > new c5e5849 inherit from archiver.py > c5e5849 is described below > > commit c5e5849ed4f73a5a265f43eba46962d70b9e2de6 > Author: Daniel Gruno <[email protected]> > AuthorDate: Sun Oct 17 22:42:08 2021 +0200 > > inherit from archiver.py > --- > tools/migrate.py | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/tools/migrate.py b/tools/migrate.py > index 8c431c3..2493465 100644 > --- a/tools/migrate.py > +++ b/tools/migrate.py > @@ -36,12 +36,11 @@ import os > import re > import time > import sys > +import archiver > > # Increment this number whenever breaking changes happen in the migration > workflow: > MIGRATION_MAGIC_NUMBER = "2" > > -# Standard "short body" max length for email aggregations > -SHORT_BODY_MAX_LEN = 200 > > # Max number of parallel conversions to perform before pushing. 75-ish > percent of max cores. > cores = len(os.sched_getaffinity(0)) > @@ -202,7 +201,7 @@ def process_document(old_es, doc, old_dbname, > dbname_source, dbname_mbox, do_dki > doc["_source"]["dbid"] = hashlib.sha3_256(source_text).hexdigest() > > # Add in shortened body for search aggs > - doc["_source"]["body_short"] = > doc["_source"]["body"][:SHORT_BODY_MAX_LEN+10] > + doc["_source"]["body_short"] = > doc["_source"]["body"][:archiver.SHORT_BODY_MAX_LEN+10]
-1 magic (and undocumented) number 10 > # Add in gravatar > header_from = doc["_source"]["from"]
