Skip to content

Commit 196a283

Browse files
authored
feat: add dropdown for RAM memory select (#56)
* feat: add dropdown for RAM memory select * fix: remove invalid RAM option
1 parent e2dbcaf commit 196a283

File tree

3 files changed

+32
-40
lines changed

3 files changed

+32
-40
lines changed

nodes/Apify/__tests__/Apify.node.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('Apify Node', () => {
163163
.get('/v2/acts/nFJndFXA5zjCTuudP/builds/default')
164164
.reply(200, mockBuild)
165165
.post('/v2/acts/nFJndFXA5zjCTuudP/runs')
166-
.query({ waitForFinish: 0, build: mockBuild.data.buildNumber })
166+
.query({ waitForFinish: 0, build: mockBuild.data.buildNumber, memory: 1024 })
167167
.reply(200, mockRunActor);
168168

169169
const runActorWorkflow = require('./workflows/actors/run-actor.workflow.json');
@@ -195,7 +195,7 @@ describe('Apify Node', () => {
195195
.get('/v2/acts/nFJndFXA5zjCTuudP/builds/default')
196196
.reply(200, mockBuild)
197197
.post('/v2/acts/nFJndFXA5zjCTuudP/runs')
198-
.query({ waitForFinish: 0, build: mockBuild.data.buildNumber })
198+
.query({ waitForFinish: 0, build: mockBuild.data.buildNumber, memory: 1024 })
199199
.reply(200, mockRunActor)
200200
.get('/v2/actor-runs/Icz6E0IHX0c40yEi7')
201201
.reply(200, mockFinishedRun);

nodes/Apify/resources/actor-tasks/run-task/properties.ts

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ export const properties: INodeProperties[] = [
5353
typeOptions: {
5454
maxValue: 60,
5555
},
56-
routing: {
57-
request: {
58-
qs: {
59-
waitForFinish: '={{ $value || $value === 0 ? $value : undefined }}',
60-
},
61-
},
62-
},
6356
displayOptions: {
6457
show: {
6558
resource: ['Actor tasks'],
@@ -74,13 +67,6 @@ export const properties: INodeProperties[] = [
7467
timeout specified in the task settings.`,
7568
default: null,
7669
type: 'number',
77-
routing: {
78-
request: {
79-
qs: {
80-
timeout: '={{ $value || $value === 0 ? $value : undefined }}',
81-
},
82-
},
83-
},
8470
displayOptions: {
8571
show: {
8672
resource: ['Actor tasks'],
@@ -91,18 +77,21 @@ timeout specified in the task settings.`,
9177
{
9278
displayName: 'Memory',
9379
name: 'memory',
94-
description: `Memory limit for the run, in megabytes. The amount of memory can be set
95-
to a power of 2 with a minimum of 128. By default, the run uses a memory
96-
limit specified in the task settings.`,
97-
default: null,
98-
type: 'number',
99-
routing: {
100-
request: {
101-
qs: {
102-
memory: '={{ $value }}',
103-
},
104-
},
105-
},
80+
description:
81+
'Memory limit for the run, in megabytes. The amount of memory can be set to one of the available options. By default, the run uses a memory limit specified in the task settings.',
82+
default: 1024,
83+
type: 'options',
84+
options: [
85+
{ name: '128 MB', value: 128 },
86+
{ name: '256 MB', value: 256 },
87+
{ name: '512 MB', value: 512 },
88+
{ name: '1024 MB (1 GB)', value: 1024 },
89+
{ name: '2048 MB (2 GB)', value: 2048 },
90+
{ name: '4096 MB (4 GB)', value: 4096 },
91+
{ name: '8192 MB (8 GB)', value: 8192 },
92+
{ name: '16384 MB (16 GB)', value: 16384 },
93+
{ name: '32768 MB (32 GB)', value: 32768 },
94+
],
10695
displayOptions: {
10796
show: {
10897
resource: ['Actor tasks'],
@@ -118,13 +107,6 @@ number. By default, the run uses the build specified in the task
118107
settings (typically \`latest\`).`,
119108
default: '',
120109
type: 'string',
121-
routing: {
122-
request: {
123-
qs: {
124-
build: '={{ $value }}',
125-
},
126-
},
127-
},
128110
displayOptions: {
129111
show: {
130112
resource: ['Actor tasks'],

nodes/Apify/resources/actors/run-actor/properties.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,21 @@ timeout specified in the default run configuration for the Actor.`,
5858
{
5959
displayName: 'Memory',
6060
name: 'memory',
61-
description: `Memory limit for the run, in megabytes. The amount of memory can be set
62-
to a power of 2 with a minimum of 128. By default, the run uses a memory
63-
limit specified in the default run configuration for the Actor.`,
64-
default: null,
65-
type: 'number',
61+
description:
62+
'Memory limit for the run, in megabytes. The amount of memory can be set to one of the available options. By default, the run uses a memory limit specified in the default run configuration for the Actor.',
63+
default: 1024,
64+
type: 'options',
65+
options: [
66+
{ name: '128 MB', value: 128 },
67+
{ name: '256 MB', value: 256 },
68+
{ name: '512 MB', value: 512 },
69+
{ name: '1024 MB (1 GB)', value: 1024 },
70+
{ name: '2048 MB (2 GB)', value: 2048 },
71+
{ name: '4096 MB (4 GB)', value: 4096 },
72+
{ name: '8192 MB (8 GB)', value: 8192 },
73+
{ name: '16384 MB (16 GB)', value: 16384 },
74+
{ name: '32768 MB (32 GB)', value: 32768 },
75+
],
6676
displayOptions: {
6777
show: {
6878
resource: ['Actors'],

0 commit comments

Comments
 (0)