Skip to content

Instantly share code, notes, and snippets.

name: Latest YouTube Videos
on:
schedule:
# Runs every hour
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-readme-with-youtube:
name: Update this repo's README with latest videos from YouTube
CREATE TABLE IF NOT EXISTS shedlock(
name VARCHAR(64) NOT NULL,
locked_at TIMESTAMP NOT NULL,
lock_until TIMESTAMP NOT NULL,
locked_by VARCHAR(255) NOT NULL,
PRIMARY KEY (name)
);
package com.sample.spring.scheduler;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
package com.sample.spring;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
package com.spring.redis.streams.repository;
import com.spring.redis.streams.dto.Movie;
import com.spring.redis.streams.dto.MovieDetails;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
package com.spring.redis.streams.publisher;
import com.spring.redis.streams.dto.MovieDetails;
import com.spring.redis.streams.repository.MovieRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.stream.ObjectRecord;
package com.spring.redis.streams.config;
import com.spring.redis.streams.dto.MovieDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
package com.spring.redis.streams.config;
import com.spring.redis.streams.dto.MovieDetails;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.stream.ObjectRecord;
import org.springframework.data.redis.core.ReactiveRedisTemplate;
import org.springframework.data.redis.stream.StreamListener;
version: '3'
services:
redis:
image: redis
ports:
- 6379:6379
redis-commander:
image: rediscommander/redis-commander:latest
depends_on:
- redis
version: '3'
services:
master:
container_name: master
image: redis
ports:
- 6379:6379
slave-a:
container_name: slave-a
image: redis