mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-19 05:37:53 +00:00
Remove unnecessary async/await from method
Signed-off-by: Christina Ying Wang <christina@balena.io>
This commit is contained in:
parent
6e6f79c71d
commit
9e249e6ae8
@ -189,9 +189,9 @@ export class App {
|
||||
return steps;
|
||||
}
|
||||
|
||||
public async stepsToRemoveApp(
|
||||
public stepsToRemoveApp(
|
||||
state: Omit<UpdateState, 'availableImages'> & { keepVolumes: boolean },
|
||||
): Promise<CompositionStep[]> {
|
||||
): CompositionStep[] {
|
||||
if (Object.keys(this.services).length > 0) {
|
||||
return Object.values(this.services).map((service) =>
|
||||
generateStep('kill', { current: service }),
|
||||
|
@ -221,7 +221,7 @@ export async function inferNextSteps(
|
||||
// For apps in the current state but not target, we call their "destructor"
|
||||
for (const id of onlyCurrent) {
|
||||
steps = steps.concat(
|
||||
await currentApps[id].stepsToRemoveApp({
|
||||
currentApps[id].stepsToRemoveApp({
|
||||
keepVolumes,
|
||||
downloading,
|
||||
containerIds: containerIdsByAppId[id],
|
||||
|
@ -262,12 +262,12 @@ describe('compose/app', () => {
|
||||
.that.deep.includes({ serviceName: 'test' });
|
||||
});
|
||||
|
||||
it('should correctly infer to remove an app volumes when the app is being removed', async () => {
|
||||
it('should correctly infer to remove an app volumes when the app is being removed', () => {
|
||||
const current = createApp({
|
||||
volumes: [Volume.fromComposeObject('test-volume', 1, 'deadbeef')],
|
||||
});
|
||||
|
||||
const steps = await current.stepsToRemoveApp(defaultContext);
|
||||
const steps = current.stepsToRemoveApp(defaultContext);
|
||||
const [removeVolumeStep] = expectSteps('removeVolume', steps);
|
||||
|
||||
expect(removeVolumeStep).to.have.property('current').that.deep.includes({
|
||||
|
Loading…
Reference in New Issue
Block a user