Homec4science

Allow LiskDAO to be forced to use a specific connection

Authored by epriestley <git@epriestley.com> on Mar 17 2015, 22:43.

Description

Allow LiskDAO to be forced to use a specific connection

Summary:
Ref T7522. This seems like the least-bad approach to a messy issue:

  • When backfilling accounts from an imported instance, I need to write ExternalAccount rows to the instance to link instance accounts with upstream accounts.
  • We do this in the daemons in some other cases, which lets us run all the code in the context of the instance. However, I really want to do this in-process here because it's way way simpler and we need to do writes to both the instance and the upstream, and they're interleaved, and they depend on one another.
  • I can hard-code the query with qsprintf() but that feels like 100x worse than this.

This allows me to do this:

id(new PhabricatorExternalAccount())
  ->setForcedConnnection($instance_conn)
  ->...
  ->save();

...and get a write to the instance database, which is at least not completely a minefield.

Test Plan: Backfilled instance accounts and got interleaved instance and upstream writes as expected.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7522

Differential Revision: https://secure.phabricator.com/D12098

Details

Committed
epriestley <git@epriestley.com>Mar 17 2015, 22:43
Pushed
aubortJan 31 2017, 17:16
Parents
rPH6fc867d38225: Update Conpherence full for common colors / styles
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH827c0ce08134: Allow LiskDAO to be forced to use a specific connection (authored by epriestley <git@epriestley.com>).Mar 17 2015, 22:43