Skip to content

Investigating and diagnosing issues

Tomas Apodaca edited this page Aug 21, 2019 · 4 revisions

Tools

You can render task trees in the production console with the structure_render method. To render a task and all its descendants:

> puts Task.find(12345).structure_render(:id, :status, :closed_at)

RootTask 12345, on_hold, (closed_at)
├── DistributionTask 23456, completed, 2019-05-23 17:20:54 UTC
   ├── InformalHearingPresentationTask 34567, cancelled, 2019-03-05 22:47:22 UTC
   └── HearingTask 45678, completed, 2019-03-22 05:30:05 UTC
       ├── ScheduleHearingTask 56789, cancelled, 2019-03-21 17:14:41 UTC
       └── EvidenceSubmissionWindowTask 67890, completed, 2019-03-22 05:30:04 UTC
├── TrackVeteranTask 78901, in_progress, (closed_at)
└── JudgeAssignTask 89012, on_hold, (closed_at)
    └── AttorneyTask 90123, on_hold, (closed_at)
        └── ScheduleHearingColocatedTask 01234, completed, 2019-06-03 14:16:18 UTC
            └── ScheduleHearingColocatedTask 98765, completed, 2019-06-03 14:16:18 UTC

or for all tasks and their descendants attached to an appeal:

> puts LegacyAppeal.find(98765).structure_render(:id, :status, :closed_at)

LegacyAppeal 98765
├── RootTask 87654, on_hold, (closed_at)
   └── HearingTask 76543, on_hold, (closed_at)
       └── ScheduleHearingTask 65432, assigned, (closed_at)
├── AddressVerificationColocatedTask 54321, completed, 2019-02-11 15:22:17 UTC
   └── AddressVerificationColocatedTask 43210, completed, 2019-02-11 15:22:17 UTC
└── ScheduleHearingColocatedTask 32109, completed, 2019-02-11 15:21:31 UTC
    └── ScheduleHearingColocatedTask 21098, completed, 2019-02-11 15:21:31 UTC

The symbols you pass the method are the attributes that'll be printed next to each task in the tree.

Clone this wiki locally