Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
186
Issues
186
List
Boards
Labels
Service Desk
Milestones
Merge Requests
33
Merge Requests
33
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
1f852b07
Commit
1f852b07
authored
1 hour ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(chore): Use decimal for payments; impressions threshold
parent
329a40c3
goal/boost-campaigns-e24
1 merge request
!235
WIP: Boost Campaigns (&24)
Pipeline
#73571829
passed with stages
in 9 minutes and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
Dispatcher.php
Core/Boost/Campaigns/Dispatcher.php
+9
-3
cassandra-provision.cql
Core/Provisioner/Provisioners/cassandra-provision.cql
+1
-1
No files found.
Core/Boost/Campaigns/Dispatcher.php
View file @
1f852b07
...
...
@@ -10,7 +10,7 @@ use Exception;
class
Dispatcher
{
const
SAVE_DELTA
=
10
;
const
IMPRESSIONS_SYNC_THRESHOLD
=
1
;
/** @var Manager */
protected
$manager
;
...
...
@@ -18,19 +18,25 @@ class Dispatcher
/** @var Metrics */
protected
$metrics
;
/** @var int */
protected
$impressionsSyncThreshold
;
/**
* Dispatcher constructor.
* @param Manager $manager
* @param Metrics $metrics
* @param int $impressionsSyncThreshold
* @throws Exception
*/
public
function
__construct
(
$manager
=
null
,
$metrics
=
null
$metrics
=
null
,
$impressionsSyncThreshold
=
null
)
{
$this
->
manager
=
$manager
?:
new
Manager
();
$this
->
metrics
=
$metrics
?:
new
Metrics
();
$this
->
impressionsSyncThreshold
=
$impressionsSyncThreshold
?:
static
::
IMPRESSIONS_SYNC_THRESHOLD
;
}
/**
...
...
@@ -50,7 +56,7 @@ class Dispatcher
->
setCampaign
(
$campaign
)
->
syncImpressionsMet
();
if
(
$campaign
->
getImpressionsMet
()
-
$impressionsMet
>=
static
::
SAVE_DELTA
)
{
if
(
$campaign
->
getImpressionsMet
()
-
$impressionsMet
>=
$this
->
impressionsSyncThreshold
)
{
error_log
(
"[BoostCampaignsDispatcher] Saving updated
{
$campaign
->
getUrn
()
}
..."
);
$this
->
manager
->
sync
(
$campaign
);
}
...
...
This diff is collapsed.
Click to expand it.
Core/Provisioner/Provisioners/cassandra-provision.cql
View file @
1f852b07
...
...
@@ -1467,7 +1467,7 @@ CREATE TABLE minds.boost_campaigns_payments (
campaign_guid bigint,
tx text,
source text,
amount
varint
,
amount
decimal
,
time_created timestamp,
PRIMARY KEY (owner_guid, campaign_guid, tx)
) WITH CLUSTERING ORDER BY (campaign_guid ASC, tx ASC);
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment