This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Manipulate DigitalOcean App Platform API | |
// To add custom domains on the fly when Linkbreakers is being manipulated | |
// This is a hack and not meant to stay in the system. | |
// We should go for Custom Hostname from Cloudflare on a next iteration. | |
package cluster | |
import ( | |
"context" | |
"fmt" | |
"regexp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package job_scheduler | |
import ( | |
"context" | |
"database/sql/driver" | |
"encoding/json" | |
"fmt" | |
"log" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Engines::Core::Rpc::Client.new( | |
service: ::Rpc::Services::LiveCommunications::Messages | |
).get_message( | |
::Rpc::Backend::GetMessageRequest.new( | |
message_id: "21ef149a-09ac-11ed-861d-0242ac120002" | |
) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package rpc.my_package; | |
service MyService { | |
rpc GetSomething(GetSomethingRequest) returns (GetSomethingResponse) {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# concurrent migration strategy | |
# when migrating through this script | |
# you can launch it on multiple processes | |
# and they will deal with the concurrency by | |
# themselves without interrupting or crashing | |
class MigrateConcurrently | |
class Error < StandardError; end | |
DELAY_BETWEEN_CYCLES_IN_SECONDS = 3 | |
MAX_CYCLES = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MigrateConcurrently | |
class Error < StandardError; end | |
... | |
def raise_if_max_cycles_reached | |
... | |
raise Error, ... | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MigrateConcurrently | |
DELAY_BETWEEN_CYCLES_IN_SECONDS = 3 | |
MAX_CYCLES = 100 | |
def initialize; end | |
def perform | |
Logger.info( | |
... | |
delay_between_cycles_in_seconds: DELAY_BETWEEN_CYCLES_IN_SECONDS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# concurrent migration strategy | |
# when migrating through this script | |
# you can launch it on multiple processes | |
# and they will deal with the concurrency by | |
# themselves without interrupting or crashing | |
class MigrateConcurrently | |
... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MigrateConcurrently | |
... | |
def perform | |
... | |
Logger.info( | |
... | |
cycle: cycles.current, | |
max_cycles: cycles.max, | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cycles | |
attr_reader :current, :max | |
def initialize(current: 1, max: 1) | |
@current = current | |
@max = max | |
end | |
def next | |
@current += 1 |
NewerOlder