Skip to content

Commit

Permalink
docs: add diagrams for RetryDownloading event
Browse files Browse the repository at this point in the history
Relate to #1254
Fix #1255

[skip ci]
  • Loading branch information
php-coder committed Jun 2, 2024
1 parent 5de0be1 commit e9ea0b3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
52 changes: 52 additions & 0 deletions docs/import-series-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,58 @@ sequenceDiagram
end
```

```mermaid
sequenceDiagram
title Series import flow: stage 2a (re-run a failed page downloading)
participant Browser
participant SeriesImportController
participant SeriesImportService
participant EventPublisher
opt POST /series/import/request?requestId=$id
Browser->>SeriesImportController: requestId
activate SeriesImportController
SeriesImportController->>SeriesImportService: requestId
activate SeriesImportService
SeriesImportService->>SeriesImportController: ImportRequestDto
deactivate SeriesImportService
SeriesImportController->>EventPublisher: RetryDownloading
SeriesImportController->>Browser: redirect to /series/import/request/{id}
deactivate SeriesImportController
end
```

```mermaid
sequenceDiagram
title Series import flow: stage 2b (re-downloading a page)
participant RetryDownloadingEventListener
participant SeriesImportService
participant DownloaderService
participant EventPublisher
RetryDownloadingEventListener->>SeriesImportService: requestId
activate SeriesImportService
SeriesImportService->>RetryDownloadingEventListener: ImportRequestDto
deactivate SeriesImportService
RetryDownloadingEventListener->>DownloaderService: url
activate DownloaderService
DownloaderService->>RetryDownloadingEventListener: DownloadResult
deactivate DownloaderService
RetryDownloadingEventListener->>SeriesImportService: content of downloaded page
activate SeriesImportService
SeriesImportService->>SeriesImportService:
SeriesImportService->>RetryDownloadingEventListener:
note right of SeriesImportService: DownloadingFailed -> DownloadingSucceeded
deactivate SeriesImportService
RetryDownloadingEventListener->>EventPublisher: DownloadingSucceeded
```

## Parse page

```mermaid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public String processRequestImportForm(
return redirectTo(SeriesImportUrl.REQUEST_IMPORT_PAGE, requestId);
}

// @todo #1254 Update workflow to mention RetryDownloading event
@PostMapping(path = SeriesImportUrl.REQUEST_IMPORT_SERIES_PAGE, params = "requestId")
public String rerunImport(
@RequestParam("requestId") Integer requestId,
Expand Down

0 comments on commit e9ea0b3

Please sign in to comment.