mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 23:10:44 +00:00
Refactor pipeline parsing and forge refreshing (#2527)
- refactor pipeline parsing - do not parse the pipeline multiple times to perform filter checks, do this once and perform checks on the result directly - code deduplication - refactor forge token refreshing - move refreshing to a helper func to reduce code --------- Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
@@ -29,12 +29,5 @@ export default () => {
|
||||
}
|
||||
const { pipeline } = data;
|
||||
pipelineStore.setPipeline(repo.id, pipeline);
|
||||
|
||||
// contains step update
|
||||
if (!data.step) {
|
||||
return;
|
||||
}
|
||||
const { step } = data;
|
||||
pipelineStore.setWorkflow(repo.id, pipeline.number, step);
|
||||
});
|
||||
};
|
||||
|
@@ -8,7 +8,6 @@ import {
|
||||
PipelineConfig,
|
||||
PipelineFeed,
|
||||
PipelineLog,
|
||||
PipelineWorkflow,
|
||||
PullRequest,
|
||||
QueueInfo,
|
||||
Registry,
|
||||
@@ -316,7 +315,7 @@ export default class WoodpeckerClient extends ApiClient {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
||||
on(callback: (data: { pipeline?: Pipeline; repo?: Repo; step?: PipelineWorkflow }) => void): EventSource {
|
||||
on(callback: (data: { pipeline?: Pipeline; repo?: Repo }) => void): EventSource {
|
||||
return this._subscribe('/api/stream/events', callback, {
|
||||
reconnect: true,
|
||||
});
|
||||
|
Reference in New Issue
Block a user