server {
listen 80;
server_name _;
access_log /var/log/nginx/bld_gui_access.log;
error_log /var/log/nginx/bld_gui_error.log;
root /var/www;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api_v1/ {
# root /var/www/html/api_v1/web;
rewrite ^/api_v1/(.*)$ /var/www/html/api_v1/web/index.php?r=$1;
# index index.php;
# try_files $uri $uri/ /var/www/html/api_v1/web/index.php$is_args$args;
# try_files $uri $uri/ /index.php$is_args$args;
}
location ~ [^/]\.php(/|$) {
# location ~ \.php$ {
root /var/www/html/web;
include fastcgi_params;
# fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass bld-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html/web$fastcgi_script_name;
# try_files $uri =404;
}
}
chdir = /var/www/html/web
172.31.0.1 - - [30/Dec/2022:18:58:33 +0000] "GET /api_v1/game/list HTTP/1.1" 404 36 "http://127.0.0.1:8080/list" "Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0"
2022/12/30 18:58:33 [error] 31#31: *1 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/web/var/www/html/api_v1/web/index.php (No such file or directory)" while reading response header from upstream, client: 172.31.0.1, server: _, request: "GET /api_v1/game/list HTTP/1.1", upstream: "fastcgi://172.31.0.4:9000", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/list"
127.0.0.1 - 30/Dec/2022:18:58:33 +0000 "GET /var/www/html/api_v1/web/index.php" 404
server {
listen 80;
root /var/www/html/backend/web;
index index.php;
access_log /var/www/html/access.log;
error_log /var/www/html/error.log;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass yii2-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}
Running with gitlab-runner 15.2.0~beta.17.g34ae4a68 (34ae4a68)
on blue-3.shared.runners-manager.gitlab.com/default zxwgkjAP
Preparing the "docker+machine" executor 00:11
Using Docker executor with image docker:20.10.16 ...
Pulling docker image docker:20.10.16 ...
Using docker image sha256:2a153cb5c7c52610ceb46876231f1c7ab8d2a0926aaeb5283994ef3d6f78def9 for docker:20.10.16 with digest docker@sha256:5bc07a93c9b28e57a58d57fbcf437d1551ff80ae33b4274fb60a1ade2d6c9da4 ...
Preparing environment 00:03
Running on runner-zxwgkjap-project-30457055-concurrent-0 via runner-zxwgkjap-shared-1658524451-af2d1fff...
Getting source from Git repository 00:02
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/taxivek/takivek-ionic/.git/
Created fresh repository.
Checking out d98c03ac as test_simple_gitlabci...
Skipping Git submodules setup
Executing "step_script" stage of the job script 00:00
Using docker image sha256:2a153cb5c7c52610ceb46876231f1c7ab8d2a0926aaeb5283994ef3d6f78def9 for docker:20.10.16 with digest docker@sha256:5bc07a93c9b28e57a58d57fbcf437d1551ff80ae33b4274fb60a1ade2d6c9da4 ...
$ echo "${ACCESS_TOKEN}" || docker login -u Deployer --password-stdin registry.gitlab.com
$ docker build -t my-docker-image -f ./docker/Dockerfile .
error during connect: Post "http://docker:2375/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=docker%2FDockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=my-docker-image&target=&ulimits=null&version=1": dial tcp: lookup docker on 169.254.169.254:53: no such host
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
image: docker:20.10.16
build:
before_script:
- echo "${ACCESS_TOKEN}" || docker login -u Deployer --password-stdin registry.gitlab.com
script:
- docker build -t my-docker-image -f ./docker/Dockerfile .
artifacts:
paths:
- workdir/android/app/build/outputs/apk/debug/*.apk
FROM ubuntu:18.04 as prepare
ARG JAVA_VERSION=11
ARG NODEJS_VERSION=16
ARG ANDROID_SDK_VERSION=8512546
ARG ANDROID_BUILD_TOOLS_VERSION=31.0.0
ARG ANDROID_PLATFORMS_VERSION=29
ARG ANDROID_CMDLINE_TOOLS_FOLDER=cmdline-tools
ARG GRADLE_VERSION=7.0
RUN apt-get update -q
# General packages
RUN apt-get install -qy \
curl \
unzip \
openjdk-${JAVA_VERSION}-jre \
openjdk-${JAVA_VERSION}-jdk
# Install Gradle
ENV GRADLE_HOME=/opt/gradle
RUN mkdir $GRADLE_HOME \
&& curl -sL https://downloads.gradle-dn.com/distributions/gradle-${GRADLE_VERSION}-bin.zip -o gradle-${GRADLE_VERSION}-bin.zip \
&& unzip -d $GRADLE_HOME gradle-${GRADLE_VERSION}-bin.zip
ENV PATH=$PATH:/opt/gradle/gradle-${GRADLE_VERSION}/bin
# Install Android SDK tools
ENV ANDROID_HOME=/opt/android-sdk
RUN curl -sL https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip -o commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip \
&& unzip commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip \
&& mkdir $ANDROID_HOME && mv ${ANDROID_CMDLINE_TOOLS_FOLDER} $ANDROID_HOME \
&& yes | $ANDROID_HOME/${ANDROID_CMDLINE_TOOLS_FOLDER}/bin/sdkmanager --sdk_root=$ANDROID_HOME --licenses \
&& $ANDROID_HOME/${ANDROID_CMDLINE_TOOLS_FOLDER}/bin/sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platforms;android-${ANDROID_PLATFORMS_VERSION}"
ENV PATH=$PATH:${ANDROID_HOME}/${ANDROID_CMDLINE_TOOLS_FOLDER}:${ANDROID_HOME}/platform-tools
# Install NodeJS
RUN curl -sL https://deb.nodesource.com/setup_${NODEJS_VERSION}.x | bash - \
&& apt-get update -q && apt-get install -qy nodejs
ENV NPM_CONFIG_PREFIX=${HOME}/.npm-global
ENV PATH=$PATH:${HOME}/.npm-global/bin
# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
WORKDIR /workdir
COPY . /workdir/
RUN npm install -g @ionic/cli
RUN npm install @capacitor/core
RUN npm install @capacitor/cli --save-dev
RUN npm install --save
RUN ionic capacitor copy android
import { Component, OnInit } from '@angular/core';
import { timer, pipe } from 'rxjs';
import { tap, takeWhile } from 'rxjs/operators';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'test-timers';
latency = 5000;
time1onoff = true;
timer1;
time2onoff = false;
timer2;
ngOnInit(){
console.log('init');
this.timer1 = timer(0, this.latency).pipe(
takeWhile( val => this.time1onoff )
).subscribe((val) => {
if (val == 10){
this.latency = this.latency * 2;
this.time1onoff = false;
this.time2onoff = true;
}
console.log(val)
});
this.timer2 = timer(0, this.latency).pipe(
takeWhile( val => this.time2onoff )
).subscribe((val) => {
if (val == 10){
this.latency = this.latency * 2;
this.time1onoff = true;
this.time2onoff = false;
}
console.log(val)
});
}
}
var start = new Date().getTime(),
time = 0,
elapsed = '0.0';
function instance()
{
time += 100;
elapsed = Math.floor(time / 100) / 10;
if(Math.round(elapsed) == elapsed) { elapsed += '.0'; }
document.title = elapsed;
var diff = (new Date().getTime() - start) - time;
window.setTimeout(instance, (100 - diff));
}
window.setTimeout(instance, 100);
Создание нового потока путем слияния двух интервалов, и складирование подписок в одну для удобной отписки всех скопом.Но при слиянии потов ведь тоже будет одна подписка, только, как я понимаю, логику придется писать в одном subscribe вместо нескольких, как это работает сейчас.
А filter это фильтр, фильтрует поток по условию, не понял какая тут может быть пауза.Изначально я хотел сделать что-то похожее на это:
if (need_start_timer){
timer_step.start();
} else {
timer_step.pause();
}
this.reloadGameInfoSubscription = this.reloadGameInfo$
.pipe(
mergeMap((x) => this.gameService.getInfoGame(this.current_game.auth_key)
.pipe(
map((game: Game) => {
return { tick: x, game: game };
})
)
)
).subscribe((response: { tick: number, game: Game }) => {
/*
логика обработки
*/
});
this.stepTimerSubscription = this.stepTimer$
.pipe(
filter(() => this.current_game.current_seconds_for_step > 0
&& this.field.start_word.length > 0
&& this.current_game.status_id == gameStatusCode.two_player_in_game),
).subscribe(() => {
if (--this.current_game.current_seconds_for_step == 0) {
this.gameService.skipStep(this.current_game.auth_key)
.pipe(
mergeMap((skipStepResponse) => this.gameService.getInfoGame(this.current_game.auth_key)
.pipe(
map((game: Game) => {
return { skipStepResponse: skipStepResponse, game: game };
}))
)
)
.subscribe(
(response) => {
if (response.skipStepResponse.success) {
this.current_game.current_seconds_for_step = this.current_game.default_seconds_for_step;
this.gameService.setInfoGame(response.game);
}
}
);
}
});
this.stepTimer$
.pipe(
filter(() => this.current_game.current_seconds_for_step > 0
&& this.field.start_word.length > 0
&& this.current_game.status_id == gameStatusCode.two_player_in_game),
).subscribe();
reloadGameInfo = interval(10000);
stepTimer = interval(1000);
second_to_event = 100;
this.reloadGameInfoSubscription = this.reloadGameInfo.subscribe(() => {
this.gameService.getInfoGame(this.current_game.auth_key)
.subscribe((response: Game) => {
/* update game info */
});
});
this.stepTimerSubscription = this.stepTimer
.pipe(filter(() => this.current_game.current_seconds_for_step > 0))
.subscribe(() => {
if (--this.current_game.current_seconds_for_step == 0) {
this.gameService.skipStep(this.current_game.auth_key).subscribe(
(response: any) => {
if (response.success) {
this.current_game.current_seconds_for_step = this.current_game.default_seconds_for_step;
}
}
);
}
});
of(1,2,3).map(x => x + 1).filter(x => x > 2);
of(1,2,3).pipe(
map(x => x + 1),
filter(x => x > 2)
);
? Или это сделано для другого?map.locate({enableHighAccuracy: true, timeout: 3000})
Пол:15 http://mirror.yandex.ru/debian stretch/non-free Translation-en [80,1 kB]
0% [Обработка]
# deb cdrom:[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45]/ stretch contrib main
# deb cdrom:[Debian GNU/Linux 9.1.0 _Stretch_ - Official i386 DVD Binary-1 20170722-12:45]/ stretch main contrib
#deb http://security.debian.org/debian-security/ stretch/updates contrib main
# deb-src http://security.debian.org/debian-security/ stretch/updates main contrib
# stretch-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#deb http://deb.debian.org/debian/ stretch-updates main contrib
# deb-src http://deb.debian.org/debian/ stretch-updates contrib main
#deb http://ftp.debian.org/debian/ stretch main non-free
#deb http://dl.winehq.org/wine-builds/debian/ stretch main
#deb http://deb.debian.org/debian/ stretch main contrib non-free
deb http://download.virtualbox.org/virtualbox/debian/ stretch contrib
deb http://mirror.yandex.ru/debian/ stretch main contrib non-free
nginx.conf:
У вас в php-fpm контейнере работает один скрипт php или php фреймворк?