// Nothing to do for already-encoded databases.
// TODO(github.com/ChrisCummins/clgen/issues/130): Refactor this after
// splitting out Corpus class.
if self.config.HasField("pre_encoded_corpus_url"):
return
preprocessed_lock_path = pathlib.Path(
self.preprocessed.url[len("sqlite:///"):]).parent / "LOCK"
with lockfile.LockFile(preprocessed_lock_path):
self.preprocessed.Create(self.config)
After Change
config_to_store.ClearField("contentfiles")
corpus = session.GetOrAdd(
dashboard_db.Corpus,
config_proto_sha1=crypto.sha1(config_to_store.SerializeToString()),
config_proto=str(config_to_store),
preprocessed_url=self.preprocessed.url,
encoded_url=self.encoded.url,
summary=self.GetShortSummary(),
)
session.flush()
self._dashboard_db_id = corpus.id
@property
def dashboard_db_id(self) -> int:
if not self._created: