Skip to content

Commit 37b7baa

Browse files
authored
Merge pull request #863 from bozana/9822
pkp/pkp-lib#9822 Increase timeout and improve DB table indexes for usage stats jobs
2 parents 4d62bd2 + 174a4af commit 37b7baa

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

classes/migration/install/MetricsMigration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function up(): void
270270
$table->string('city', 255)->default('');
271271
$table->string('load_id', 50);
272272

273-
$table->index(['load_id', 'context_id', 'ip'], 'ust_load_id_context_id_ip');
273+
$table->index(['load_id', 'context_id', 'ip', 'user_agent', 'canonical_url'], 'ust_load_id_context_id_ip_ua_url');
274274
});
275275

276276
// Usage stats unique item investigations temporary records
@@ -306,7 +306,7 @@ public function up(): void
306306
$table->string('city', 255)->default('');
307307
$table->string('load_id', 50);
308308

309-
$table->index(['load_id', 'context_id', 'ip'], 'usii_load_id_context_id_ip');
309+
$table->index(['load_id', 'context_id', 'ip', 'user_agent'], 'usii_load_id_context_id_ip_ua');
310310
});
311311

312312
// Usage stats unique item requests temporary records
@@ -341,7 +341,7 @@ public function up(): void
341341
$table->string('city', 255)->default('');
342342
$table->string('load_id', 50);
343343

344-
$table->index(['load_id', 'context_id', 'ip'], 'usir_load_id_context_id_ip');
344+
$table->index(['load_id', 'context_id', 'ip', 'user_agent'], 'usir_load_id_context_id_ip_ua');
345345
});
346346

347347
// Usage stats institution temporary records

dbscripts/xml/upgrade.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<upgrade minversion="3.4.0.0" maxversion="3.4.0.5">
110110
<!-- Only new 3.4 installations need this fix -->
111111
<migration class="PKP\migration\upgrade\v3_4_0\I8592_SiteNotificationSubscriptions"/>
112+
<migration class="PKP\migration\upgrade\v3_4_0\I9822_ChangeUsageStatsTemporaryTablesIndexes"/>
112113
</upgrade>
113114

114115
<upgrade minversion="3.1.0.0" maxversion="3.4.9.9">

jobs/statistics/CompileUniqueInvestigations.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
class CompileUniqueInvestigations extends BaseJob
2424
{
25+
public int $timeout = 600;
26+
2527
/**
2628
* Create a new job instance.
2729
*

jobs/statistics/CompileUniqueRequests.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
class CompileUniqueRequests extends BaseJob
2424
{
25+
public int $timeout = 600;
26+
2527
/**
2628
* Create a new job instance.
2729
*

0 commit comments

Comments
 (0)