s365b.core.engine¶
The backup engine: drives a module’s backup of one protected object.
It connects the three parts that do not know about each other: the module (what to read), the repository (where content goes) and the catalog (what was stored when).
Attributes¶
Classes¶
Outcome of backing up one protected object. |
|
Runs module backups and records the results. |
Module Contents¶
- class s365b.core.engine.ObjectResult[source]¶
Outcome of backing up one protected object.
- Variables:
object_fk – Protected object row ID.
stats – What was stored.
checkpoints – Number of checkpoints committed.
error – Error message if the backup failed part-way.
changes –
(change, version)for each item added, changed or deleted, only if the object had been backed up before.track_changes – Whether
changesis collected (not the object’s first backup, nor the first with a new module version).extras – Extra copies added to items (see
BackupModule.extra_copies()).extras_missing – Current items still without an extra copy after this run (e.g. messages that cannot be restored yet).
extras_error – Why the last extras pass stopped, if it failed.
- changes: list[tuple[str, s365b.modules.sdk.ItemVersion]] = [][source]¶
- class s365b.core.engine.BackupEngine(db: s365b.db.session.Database, repo: s365b.storage.repository.Repository, repository_fk: int)[source]¶
Runs module backups and records the results.
- Parameters:
db – Database.
repo – Open repository for content.
repository_fk – Database ID of that repository.
- async backup_object(module: s365b.modules.sdk.BackupModule, ctx: s365b.modules.sdk.ModuleContext, row: s365b.db.models.ProtectedObjectRow, *, run_fk: int | None = None, on_stats: collections.abc.Callable[[s365b.core.catalog.VersionStats], None] | None = None) ObjectResult[source]¶
Back up one protected object incrementally.
Errors inside the module are caught and reported in the result; everything up to the last checkpoint stays committed, so the next run resumes from there.
- Parameters:
module – The module that owns the object.
ctx – Module context for this job.
row – The protected object’s catalog row.
run_fk – Current job run, recorded on each version.
on_stats – Called after each commit with what that commit stored (for live progress).
- Returns:
The outcome.